读书人

Replace 方法没有采用 3 个参数的重载

发布时间: 2012-03-31 13:13:26 作者: rapoo

Replace 方法没有采用 3 个参数的重载
<%# strreplace((string)DataBinder.Eval(Container.DataItem, "title "),(string)Session[ "searchkey "], " <font color=red> "+(string)Session[ "searchkey "]+ " </font> ") %>
public string strreplace(string str,string str_1,string str_2)
{
string returnstr=str;
string s1,s2;
s1=str_1;
s2=str_2;
returnstr=returnstr.Replace(returnstr,s1,s2);
return returnstr;
}
//一运行出现了下面的错误
Replace 方法没有采用 3 个参数的重载

请各位朋友帮帮忙呀

[解决办法]
returnstr.Replace(returnstr,s1,s2);
-->
returnstr.Replace(s1,s2);

读书人网 >asp.net

热点推荐