About
Pricing
Community
Teams
Start Free Trial
Log in
chokka
asked on
2/15/2010
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#
3
1
Last Comment
chokka
8/22/2022 - Mon
Reza Rad
2/15/2010
string strPhone = " (444)444-4444";
MessageBox.Show(strPhone.R
eplace("("
, "").Replace(")", "").Replace("-", "").Replace(" ", ""));
ASKER CERTIFIED SOLUTION
Reza Rad
2/15/2010
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
2/15/2010
ASKER
Works .. Thanks ..!
Your help has saved me hundreds of hours of internet surfing.
fblack61
MessageBox.Show(strPhone.R