The palindrome code in ruby is very short also similar to other OOP languages. Check my code below.
#!/usr/bin/env ruby print "Enter string: " str = gets strnew = str.downcase.scan(/\w/) if strnew == strnew.reverse puts strnew.to_s << " is a palindrome" end