string s="sdfjls广东sdfx564565498广东xcv898广东";
string fs="广东";
string th="东莞";
//先找出位置
int pos=s.indexOf(fs);
//取位置前部分+替换字符串+位置(加上查找字符长度)后部分
string newstr = s.substring(0,pos)+th+s.substring(pos+fs.length);
08-24
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交