java check palindrome with string builder

Solutions on MaxInterview for java check palindrome with string builder by the best coders in the world

showing results for - "java check palindrome with string builder"
Irene
14 Apr 2019
1public static boolean isPalindrome(String str){  
2    StringBuilder sb=new StringBuilder(str);  
3    sb.reverse();  
4    String rev=sb.toString();  
5    if(str.equals(rev)){  
6        return true;  
7    }else{  
8        return false;  
9    }  
10}  
Greta
19 Sep 2018
1//This function generates a palindrom by recursively reversing a String,
2//recursively add it and checks if it's a palindrom
3
4public static String generatePalindrom(String s) {
5	return s.equals(reverseString(s)) ? s
6				: generatePalindrom(String.valueOf(Integer.parseInt(s) + Integer.parseInt(reverseString(s))));
7}
8
9public static String reverseString(String s) {
10	return s.length() == 1 ? s : s.charAt(s.length() - 1) + reverseString(s.substring(0, s.length() - 1));
11}
queries leading to this page
break the palindrome in javapalindrome javapalindrom program using javalongest palindrome javapalindrome range in javachecking palindrome string in javastring palindrome in java using stringbuildergenerate palindrome javalargest palindrome in string javaadd palindrome math javabreak a palindrome in javacreate palindrom of size k in javadevelop a palindrome checker using the java string application palindrome for integer in javapalindrome no in java gfgcheck number palindrome program javafind all possible palindromes in javacheck palindrome java with loopwap for palindrom javadevelop a java program a string palindrome or nothow to generate palindrome numbers in javapalindrome in java middle elementpalindromes in javainteger palindrome program in javajava coding palindromepalidrome number in javajava palindrome codepalindrome in java using string buipalindrome test javajava program to0 find palindrome numberspalindrome in java programis palindrome javapalindrome number program in javajava check palindrome with string builderpalindromenumber in javapalindrome for phrase in javapalindrome in javaafind all possible palindromes in a string in javastring palindrome program in javajava program to check palindrome stringpalindrome with javapalindrome of string in javapalindrome with normized string in javahow to check palindrome string in javanumber palindrome in javapalindrom using menthod javaarray palindrome javastring palindrome in java using arraycreate palindrome of size n in javapalindrome purpose in javapalindrome check in javahow to find palindrome string in javacode for palindrome in javawap to check palindrome string in javapalindrome string javacheck palindrome string javajava is palindrome methodpalindrome logic in javajava palindrome indexcheck palindrome string in javarekursive palindrome javapalindrome strings in javaanti palindrome string in javahow to find the largest palindrome in javajava palindromepalindrome in java using for looppalindrome string javafunzione palindroma javapalindrom in javapalindrome number in javak palindrome program in javahow to check palindrome string in java 3fpalindrome number javapalindrome of integer in javainteger palindrome in javawrite a java program to find if the given number is palindrome or notpalindrome program in javapalindrome pgm in javacheck palindrome javacheck palindrome in javastring is palindrome or not in javathe palindrome game java solutionjava program to check palindromejava palindrome programpalindrome string in javapalindrome java intpalindrome code in javapalindrome java programcheck string is palindrome or not javasimplify a string for palindrome javacheck palindrome string using string class in javapalindrome number in java given indexpossible palindrome integer in javastring is palindrome or not javapalindromo javajava for palindromedo palindrome string in java programpalindrome in javapalindrome no in javajava check palindrome with string builder