I am developing web application using C#. I want to replace multiple character in a string. For example,
string str = "abc_def|ghij_klmn:opq|rst:uv_wx|yz";
str = str.Replace("_","-");
str = str.Replace("|",", ");
str = str.Replace(":",". ");
OR
string str = "abc_def|ghij_klmn:opq|rst:uv_wx|yz";
str = str.Replace("_","-").Replace("|",", ").Replace(":",". ");
The above are the sample coding, actually I want to replace more characters. Is there any performance related issue in above two codes?
This may be a duplicate question, I searched for that, but I didn't find...
Thanks