Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java check palindrome with string builder

public static boolean isPalindrome(String str){  
    StringBuilder sb=new StringBuilder(str);  
    sb.reverse();  
    String rev=sb.toString();  
    if(str.equals(rev)){  
        return true;  
    }else{  
        return false;  
    }  
}  
Source by www.javatpoint.com #
 
PREVIOUS NEXT
Tagged: #java #check #palindrome #string #builder
ADD COMMENT
Topic
Name
2+2 =