public static boolean isPalindrome(String s) {
        if (s == null || s.length() == 0) {
            return true;
        }

        boolean flag = true;

        int bt = 0, ed = s.length() - 1;

        while (bt < ed) {
            while (bt < ed && !isAlphanumeric(s.charAt(bt))) {
                bt++;
            }
            while (bt < ed && !isAlphanumeric(s.charAt(ed))) {
                ed--;
            }

            if (Character.toUpperCase(s.charAt(bt)) != Character.toUpperCase(s.charAt(ed))) {
                flag = false;
                break;
            } else {
                bt ++;
                ed --;
            }
        }

        return flag;
    }