Daily Challenge #35

Phone Number Word Decoder

Create a program that converts a phone number with letters to one with only numbers.

Number Letter
0 none
1 none
2 ABC
3 DEF
4 GHI
5 JKL
6 MNO
7 PQRS
8 TUV
9 WXYZ

Examples

textToNum("123-647-EYES") ➞ "123-647-3937"

textToNum("(325)444-TEST") ➞ "(325)444-8378"

textToNum("653-TRY-THIS") ➞ "653-879-8447"

textToNum("435-224-7613") ➞ "435-224-7613"

Notes

  • All inputs will be formatted as a string representing a proper phone number in the format XXX-XXX-XXXX or (XXX)XXX-XXXX , using numbers and capital letters.
5 Likes

/Boban

6 Likes


a 20 blocks solution

Taifun

8 Likes

I just reused my own blocks The Block Section Of This Aia Lags A Lot? It Is Hard To Work On It

/Boban

4 Likes