c# - String find and replace -


i have string like

string text="~aaa~bbb~ccc~bbbddd"; 

the input value : bbb

so in above string should remove value "~bbb"

the resulting string should be

text="~aaa~ccc~bbbddd"; 

i'm not sure wanna if i've got can :

private string replacefirstoccurrence(string source, string find, string replace) {  int place = source.indexof(find);  string result = source.remove(place, find.length).insert(place, replace);  return result; }  var result =replacefirstoccurrence(text,"~"+input,""); 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -