How use sting method tochararray


Discuss the below:

Q: A palindrome is a string that will spell the same way forward and backward. Some examples of palindromes are "radar", "able was I ere I saw elba" and (if blanks are ignored) "a man a plan a canal panama". Write a recursive method testPalindrome that returns boolean value true if the string stored in the array is a palindrome and false otherwise. The method should ignore spaces and punctuation in the string. [Hint: Use Sting method toCharArray, which takes no arguments, to get a char array containing the characters in the String. Then pass the array to a method testPalindrome].

Solution Preview :

Prepared by a verified Expert
JAVA Programming: How use sting method tochararray
Reference No:- TGS01935380

Now Priced at $20 (50% Discount)

Recommended (98%)

Rated (4.3/5)