Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 1 pts A palindrome is a word or phrase that reads the same forwards as backwards, ignoring case, punctuation, and nonword characters. (A

image text in transcribed
Question 1 1 pts A palindrome is a word or phrase that reads the same forwards as backwards, ignoring case, punctuation, and nonword characters. (A "nonword character" is defined for our purposes as "a character that Ruby regular expressions would treat as a nonword character) Write a method 'palindrome? that returns true if its input is a palindrome. Notes: Your solution shouldn't use loops or iteration of any kind. Instead, you will find regular-expression syntax very useful; it's reviewed briefly in the recommended textbook, and the Rubular website e lets you try out Ruby regular expressions "live" Some methods that you might find useful (which you'll have to look up in the Ruby documentation tr ) include String#downcase. String#gsub, and String# reverse. Run rspec in the terminal window to test. Once everything is passing, upload your screenshot to this question. Upload Choose a File

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions