Click here to Skip to main content
15,910,872 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHelp with code for telephone validator Pin
12String27-Oct-05 10:51
12String27-Oct-05 10:51 
AnswerRe: Help with code for telephone validator Pin
Brett Peirce27-Oct-05 11:31
Brett Peirce27-Oct-05 11:31 
GeneralRe: Help with code for telephone validator Pin
12String27-Oct-05 11:40
12String27-Oct-05 11:40 
GeneralRe: Help with code for telephone validator Pin
DA_Loring10-Nov-05 0:53
DA_Loring10-Nov-05 0:53 
AnswerRe: Help with code for telephone validator Pin
12String27-Oct-05 11:39
12String27-Oct-05 11:39 
AnswerRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 15:05
protectorChristian Graus27-Oct-05 15:05 
GeneralRe: Help with code for telephone validator Pin
12String27-Oct-05 16:20
12String27-Oct-05 16:20 
GeneralRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 16:27
protectorChristian Graus27-Oct-05 16:27 
Regular expressions are built into VB.NET. Are you not allowed to use those ? The other way to do it would be to use the Split method on the string that has the phone number, and use the double.TryParse method to see if they are all numbers. You can specify to not allow decimal points. The only other step is to verify the length of hte strings, and how many groups there are. A regex will do this all for you in one go. Something like \d{3}-\d{3}-\d{4} should do it, and you can change it so the - can be a space, or whatever.


Christian Graus - Microsoft MVP - C++
GeneralRe: Help with code for telephone validator Pin
12String27-Oct-05 16:35
12String27-Oct-05 16:35 
GeneralRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 16:38
protectorChristian Graus27-Oct-05 16:38 
GeneralRe: Help with code for telephone validator Pin
12String27-Oct-05 16:40
12String27-Oct-05 16:40 
GeneralRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 16:44
protectorChristian Graus27-Oct-05 16:44 
GeneralRe: Help with code for telephone validator Pin
12String27-Oct-05 16:48
12String27-Oct-05 16:48 
GeneralRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 17:11
protectorChristian Graus27-Oct-05 17:11 
GeneralRe: Help with code for telephone validator Pin
12String27-Oct-05 17:14
12String27-Oct-05 17:14 
GeneralRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 17:23
protectorChristian Graus27-Oct-05 17:23 
GeneralRe: Help with code for telephone validator Pin
12String27-Oct-05 17:26
12String27-Oct-05 17:26 
GeneralRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 17:27
protectorChristian Graus27-Oct-05 17:27 
GeneralRe: Help with code for telephone validator Pin
12String27-Oct-05 17:31
12String27-Oct-05 17:31 
GeneralRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 17:34
protectorChristian Graus27-Oct-05 17:34 
GeneralRe: Help with code for telephone validator Pin
12String27-Oct-05 17:41
12String27-Oct-05 17:41 
GeneralRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 17:48
protectorChristian Graus27-Oct-05 17:48 
GeneralRe: Help with code for telephone validator Pin
Steve Pullan27-Oct-05 18:38
Steve Pullan27-Oct-05 18:38 
GeneralRe: Help with code for telephone validator Pin
Christian Graus27-Oct-05 18:41
protectorChristian Graus27-Oct-05 18:41 
GeneralRe: Help with code for telephone validator Pin
Dave Kreskowiak28-Oct-05 4:58
mveDave Kreskowiak28-Oct-05 4:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.