Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This version removes spaces, commas, and quotes
- # to make the plaindrome checker work on whole sentences
- input= gets.chomp
- temp = input.downcase.gsub " ", ""
- temp = temp.gsub ",", ""
- temp = temp.gsub "'", ""
- puts temp
- if temp == temp.reverse
- puts "#{input} is a palindrome"
- else
- puts "#{input} is not a palindrome"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement