StringTools
IsPalindrome
test whether a string is a palindrome
Calling Sequence
Parameters
Description
Examples
IsPalindrome( s )
s
-
string
The IsPalindrome(s) command returns the value true if s is a palindrome, and the value false otherwise. A palindrome is a string s that is equal to its reverse: s=Reverse⁡s.
If s is the empty string, the command returns true.
All of the StringTools package commands treat strings as (null-terminated) sequences of 8-bit (ASCII) characters. Thus, there is no support for multibyte character encodings, such as unicode encodings.
with⁡StringTools:
IsPalindrome⁡
true
IsPalindrome⁡aaa
IsPalindrome⁡abc
false
IsPalindrome⁡abcba
IsPalindrome⁡tenet
IsPalindrome⁡tenets
IsPalindrome⁡ROTOR
IsPalindrome⁡civic
IsPalindrome⁡semitimes
IsPalindrome⁡aibohphobia
IsPalindrome⁡ailihphilia
IsPalindrome⁡kinnikinnik
IsPalindrome⁡reliefpfeiler
IsPalindrome⁡attordidrotta
IsPalindrome⁡saippuakauppias
See Also
StringTools[IsPermutation]
Download Help Document