Skip to content

Instantly share code, notes, and snippets.

@rking

rking/a.rb Secret

Created October 8, 2012 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rking/e39bada2780584a6e330 to your computer and use it in GitHub Desktop.
Save rking/e39bada2780584a6e330 to your computer and use it in GitHub Desktop.
def palindrome? str
normalized = str.gsub(/\W/, '').downcase
normalized == normalized.reverse
end
# => nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment