Solved

Remove extra chars from phone

Posted on 2008-06-21
2
260 Views
Last Modified: 2008-06-23
I allow users to enter phone in format of (111) 999-9999

Have () and dashes.

I want to remove them before saving it. I know I can use "replace". But anyone has a function I can use to replace ALL characters...even $ or & or *?  Just keep numbers..not even keep a space...
0
Comment
Question by:Camillia
2 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 500 total points
ID: 21839508
you can use regex. you can do something like this:

Dim regex as Regex = New Regex("[^0-9]")
Dime digits as String = regex.Replace(phone, "")
0
 
LVL 7

Author Comment

by:Camillia
ID: 21839522
let me try, thanks. kamila.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now