Blogger

Delete comment from: Java67

Kishore Babu Jetty said...

private static boolean palendromeString(String str) {

boolean palentrome =false;
if(null == str || "".equalsIgnoreCase(str))
return palentrome;

//char[] stringArray = str.toCharArray();

for(int i=1;i<=str.length()-1;i++) {

if(str.charAt(i)==str.charAt(str.length()-1-i)) {
palentrome = true;

}else {
palentrome=false;
break;
}


}

return palentrome;
}

Feb 7, 2023, 3:20:21 PM


Posted to How to check is given String is a Palindrome in Java using Recursion

Google apps
Main menu