Skip to content

Instantly share code, notes, and snippets.

@steph-crown
Created October 16, 2020 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steph-crown/32a90dca80a29ba422ed9471ca3040cf to your computer and use it in GitHub Desktop.
Save steph-crown/32a90dca80a29ba422ed9471ca3040cf to your computer and use it in GitHub Desktop.
Palindrome checker
///A palindrome checker
bool checkPalindrome(String str) {
return str == reverseStr(str);
}
///A string reverser
String reverseStr(String str) {
return str.split('').reversed.join();
}
void main() {
String str = 'madam';
print(checkPalindrome(str));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment