Say I have a string
phone = "1-800-test"
I need to convert the letters to numbers.
Doing something like this doesn't work (note I'm looping it of course):
phone = phone.replace(phone.charAt(9), (char) getNumber(phone.charAt(9)));
getNumber() is a method that takes a letter and returns a number:
int getNumber(char uppercaseLetter)
Anyway, I get some weird output with the letter replaced by a weird square.
How should I replace the letters with numbers?