Numbered Alphabet

Published by ArcherHume in

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

ABCDEFGHIJKLMNOPQRSTUVW...
012345678910111213141516171819202122...

Examples

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

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

alphNum("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.