Palindrome

Punctuation and spaces between the words or lettering are allowed. Method 2Using string m…