Reading from the right: shift gets the argument, lc lower-cases it, split using an empty regex splits it into characters, grep removes all non-letters, ord returns the ASCII ordinal number of each letter, 97 corresponds to a; map replaces the characters by the numbers, join connects the numbers back to a string.
Perl solution:
Reading from the right:
shift
gets the argument,lc
lower-cases it,split
using an empty regex splits it into characters,grep
removes all non-letters,ord
returns the ASCII ordinal number of each letter, 97 corresponds toa
;map
replaces the characters by the numbers,join
connects the numbers back to a string.See join, map, ord, grep, split, lc, shift.