Question: I wrote a code to test if the inputted string is a palindrome, but I need to remove the caps, spacing, and punctuation. I can't
I wrote a code to test if the inputted string is a palindrome, but I need to remove the caps, spacing, and punctuation. I can't seem to figure out how to make my code work.

import java.util.Scanner; class Palindromef public static void main (String args[1)f Scanner kb - new Scanner (System.in); System.out.print ("Enter a word or sentence:") String line - kb.nextLine () isReverse (line); public static boolean isReverse (String line) string newLine = '' '' ; String reve r seLine '' '' ; line = line. toLowerCase() ; for (int i = 0; i = 11ne.length() - I; i++ if (Character.isLetter(line.charAt (i))) newLine += line . charAt (i) ; for (int 1-newLine . length ( )-1; i-0; i--) reverseLine += newLine . charAt (i); if (line.equals (reverseLine)) System.out.println(" Input string is a palindrome."); return true else System.out.println ("Input string is not a palindrome."); return false
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
