Palindrome Checker

mail@pastecode.io avatarunknown
java
a month ago
469 B
2
Indexable
Never
public class PalindromeChecker {
    public static void main(String[] args) {
        System.out.println(isPalindrome("A man, a plan, a canal, Panama")); // true
        System.out.println(isPalindrome("racecar")); // true
        System.out.println(isPalindrome("hello")); // false
    }

    public static boolean isPalindrome(String str) {
        // Your code here
        
        // Return true if the string is a palindrome, false otherwise
    }
}