isPalindrome property

bool get isPalindrome

Checks if string is a palindrome (reads the same forwards and backwards)

Example:

"racecar".isPalindrome; // Returns true
"hello".isPalindrome; // Returns false

Implementation

bool get isPalindrome => this == split('').reversed.join();