Created
June 30, 2015 13:52
-
-
Save vindia/26e6ceb5f0f52b1d7ce2 to your computer and use it in GitHub Desktop.
Anagrams! Mans agar! Arm a snag!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sentences = [ | |
'Don’t like this trade.', | |
'Lets do it in the dark.', | |
'Foo bar' | |
] | |
sentences.each do |sentence| | |
puts sentence.downcase.gsub!(/[^a-z]/,'').split('').sort!.join('') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment