isPalindrome property
Checks whether the String
is a palindrome.
Example
String foo = 'Hello World';
bool isPalindrome = foo.isPalindrome; // returns false;
String foo = 'racecar';
bool isPalindrome = foo.isPalindrome; // returns true;
Implementation
bool get isPalindrome {
if (isBlank) {
return false;
}
return this == reverse;
}