WLJS LogoWLJS Notebook

PalindromeQ

PalindromeQ[list] returns True if the given list is identical to Reverse[list], and False otherwise.

PalindromeQ[n] returns True if the integer n is identical to IntegerReverse[n], and False otherwise.

PalindromeQ[string] returns True if the given string is identical to StringReverse[string], and False otherwise.

Examples

Check if a string is a palindrome:

PalindromeQ["racecar"]
(* True *)

Check a number:

PalindromeQ[12321]
(* True *)

Please visit the official Wolfram Language Reference for more details.

On this page