Skip to content

Instantly share code, notes, and snippets.

@rjlutz rjlutz/main.dart
Created Jun 10, 2018

What would you like to do?
template for porting to dart
// refer to the Java code here:
// complete the dart implementation below to have the same functionality
class Palindrome {
// TODO implement check
static check(String s) {
return true;
// lambda to mimic Java's Character.isLetterOrDigit()
bool isLetterOrDigit(String s, int idx) => s[idx].contains(RegExp(r'[\da-zA-Z]'));
main() {
// should result in true,false,true,false,true,false
print(Palindrome.check('Rise to vote, sir!'));
print(Palindrome.check('Rise to xyz vote, sir!'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.