Strings In Depth19 / 19
Up next

tr and count

# tr maps characters one-to-one
puts "hello".tr("el", "ip")
# count tallies matching characters
puts "mississippi".count("s")
What you're solving

map and tally characters