DEV Community

loading...

Discussion on: Daily Challenge #47 - Alphabets

Collapse
hanachin profile image
Seiei Miyagi • Edited

ruby <3

def alphabet_position(s)
  pos = (?a..?z |> zip 1..26 |> to_h)
  s |> downcase |> scan /[a-z]/ |> map &pos |> join ' '
end