Avatar of chokka
chokka
Flag 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    





C#

Avatar of undefined
Last Comment
chokka

8/22/2022 - Mon
Reza Rad

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


ASKER CERTIFIED SOLUTION
Reza Rad

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
chokka

ASKER


Works .. Thanks ..!
Your help has saved me hundreds of hours of internet surfing.
fblack61