Given two strings, implement a function to determine if the second string is an anagram of the first. An anagram is a
word, phrase, or name formed by rearranging the letters of another, such as cinema
, formed from iceman
. Only
consider characters, not spaces or punctuation. Consider capital letters to be the same as lower case.
anagrams?('rail safety', 'fairy tales') # true
anagrams?('RAIL! SAFETY!', 'fairy tales') # true
anagrams?('Hi there', 'Bye there') # false