Link to home
Start Free TrialLog in
Avatar of chokka
chokkaFlag for United States of America

asked on

String.Replace - C# VS 2008


I am using AJAX Masked TextBox in UI -

So phone number which i entered in UI goes to string as follows ..!

string strPhone = (444)444-4444    

This throws exception while storing it database. I need to remove Special Characters ..!

How to remove special characters of the string .. and make it plain NUMBER

Expected output is..

string strPhone = 4444444444    





Avatar of Reza Rad
Reza Rad
Flag of New Zealand image

           string strPhone = " (444)444-4444";
            MessageBox.Show(strPhone.Replace("(", "").Replace(")", "").Replace("-", "").Replace(" ", ""));


ASKER CERTIFIED SOLUTION
Avatar of Reza Rad
Reza Rad
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chokka

ASKER



Works .. Thanks ..!