Created
October 16, 2020 18:03
-
-
Save steph-crown/7b2289ce79c2a20a3840282718c12d7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///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