Created
October 18, 2012 18:20
-
-
Save MichaelWhi/3913904 to your computer and use it in GitHub Desktop.
Basic Palindrome in Ruby, https://github.com/MichaelWhi/PRubyTutorial/wiki/Problems-1
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
class String | |
def palindrome? | |
self.downcase.gsub(" ", "").reverse == self.downcase.gsub(" ", "") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment