public boolean isPalindrome(String s) {
            if (s == null)
                return false;

            int fromHead = 0;
            int fromEnd = s.length() - 1;
            while (true) {
                while (fromHead < s.length()
                        && !isAlphanumeric(s.charAt(fromHead))) {
                    fromHead++;
                }

                while (fromEnd >= 0 && !isAlphanumeric(s.charAt(fromEnd))) {
                    fromEnd--;
                }

                if (fromHead >= s.length() || fromEnd < 0)
                    return true;
                else if (Character.toLowerCase(s.charAt(fromHead)) == (Character
                        .toLowerCase(s.charAt(fromEnd)))) {
                    fromHead++;
                    fromEnd--;
                    continue;
                } else {
                    return false;
                }

            }
        }