Numbered Alphabet

Published by Matt in

Create a function that converts a string of letters to their respective number in the alphabet.

ABCDEFGHIJKLMNOPQRSTUVW...
012345678910111213141516171819202122...

Examples

alph_num("XYZ") ➞ "23 24 25"

alph_num("ABCDEF") ➞ "0 1 2 3 4 5"

alph_num("JAVASCRIPT") ➞ "9 0 21 0 18 2 17 8 15 19"

Notes

  • Make sure the numbers are spaced.
  • All letters will be UPPERCASE.
Watch a quick demo on how Edabit works.