@@ -0,0 +1,808 @@
+package StringProcessing;%0Apublic class ValidPalindrome %7B%0A%0A%09public static boolean isPalindrome(String s) %7B%0A%09%09if (s.length() == 0)%0A%09%09%09return true;%0A%09%09s = s.toLowerCase();%0A%09%09int begin = 0;%0A%09%09int end = s.length() - 1;%0A%09%09while (begin %3C end) %7B%0A%09%09%09while (!Character.isLetterOrDigit(s.charAt(begin)) && begin %3C end)%0A%09%09%09%09begin++;%0A%09%09%09while (!Character.isLetterOrDigit(s.charAt(end)) && end %3E begin)%0A%09%09%09%09end--;%0A%0A%09%09%09if (s.charAt(begin) != s.charAt(end))%0A%09%09%09%09return false;%0A%09%09%09else %7B%0A%09%09%09%09begin++;%0A%09%09%09%09end--;%0A%09%09%09%7D%0A%0A%09%09%7D%0A%09%09return true;%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09String str1 = %22A man, a plan, a canal: Panama%22;%0A%0A%09%09int len = str1.length();%0A%09%09System.out.println(len);%0A%09%09if (isPalindrome(str1))%0A%09%09%09System.out.println(%22yes, it's palindrome!%22);%0A%09%09else%0A%09%09%09System.out.println(%22no, it's not palindrome!%22);%0A%0A%09%7D%0A%0A%7D%0A

valid palindrome