Check if a phone number is valid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Thomas Blake

    #1

    Check if a phone number is valid

    I need some sort of code to check if an entered phone number into a text box is valid, i.e: User inputs "078...."
    I need some sort of if statement that checks if the number has 11 characters and starts with a 0 then get rid of the 0 and keep the rest of the characters....
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    Are you loading the number into a string to start with? Try trimming the string, and use Length.

    You can easily remove the first character of a string by using .Substring(1) (to get a new modified string)

    Comment

    Working...