Remove extra chars from phone

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...
LVL 7
CamilliaAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Jaime OlivaresConnect With a Mentor Software ArchitectCommented:
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
 
CamilliaAuthor Commented:
let me try, thanks. kamila.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.