how we remove the special character from any string
for example
string sSpecailChar="rajesh have $280.00 Rs. only, What!?"
in this sample how remove the special character like $!.?
is the best solution of this problem
Special character remove from url or any string
553806-Dec-2010
Amit Singh
06-Dec-2010we remove the special char from any string
for example:
firstly, we use System.Text.RegularExpressions namespce
string strData = "rajesh have $280.00 Rs. only, What!?";
string pattern = "[^a-zA-Z0-9]+";
Regex rgx = new Regex(pattern);
Response.Write("<font color='green'>Before Replace: </font> " + strData+"<br/>");
Response.Write("<font color='green'>After Repalce: </font>" + rgx.Replace(strData, " "));
output:
After Repalce: rajesh have 280 00 Rs only What