Function Codes Ciphers Class

TelephoneNumberLettersToDigits

Converts a telephone number containing letters and numbers to the equivalent number-only string.

Signature (Visual Basic / VBA)

Public Function TelephoneNumberLettersToDigits( _
    ByVal vTelephoneNumber As Variant _
    ) As Variant

Code Example

    TelephoneNumberLettersToDigits("1-800-554-UNIX") = "1-800-554-8649"
    TelephoneNumberLettersToDigits("1-800-QUIT-NOW") = "1-800-Q848-669"

Notes & Version History

Summary The algorithm uses a straight substitution to replace most alphabetic characters with the telephone dialing keypad number that they represent.
Note There is no translation for the letters "Q" and "Z"--they remain unchanged in the result string.
vValue The string which represents a telephone number and is to have its alphabetic characters replaced with the appropriate number. Function returns Null if vValue is Null or cannot be fixed up to a String.