my code works but only for words...How could i make my code so it can also tell if phrases (such as taco cat) are palindromes.
package Homework5; import java.util.Scanner; class HW5 { public static void main(String args[]) { String original, reverse = ""; Scanner in = new Scanner(System.in); System.out.println("Enter a word or phrase and I’ll tell you if it’s a palindrome."); original = in.nextLine(); int length = original.length(); for ( int i = length - 1; i >= 0; i-- ) { reverse = reverse + original.charAt(i); } if (original.equals(reverse)) { System.out.println(original+ " is a palindrome!"); } else { System.out.println(original+ " is not a palindrome!"); } }