My requirement is:
I have to replace some special characters like * ' " , _ & # ^ @ with
string.Empty
, and I have to replace blank spaces with-
.
This is my code:
Charseparated = Charseparated
.Replace("*","")
.Replace("'","")
.Replace("&","")
.Replace("@","") ...
For so many characters to replace I have to use as many as Replace
's which I want to avoid.
Is there another efficient way to remove the special characters, but at the same time replace blank spaces with -
?