Skip to content

Instantly share code, notes, and snippets.

@bwnyasse
Last active January 24, 2022 04:24
Show Gist options
  • Save bwnyasse/3697fa4ed500456b6774e4f510cc6195 to your computer and use it in GitHub Desktop.
Save bwnyasse/3697fa4ed500456b6774e4f510cc6195 to your computer and use it in GitHub Desktop.
/*
* Dart & Flutter - Training
*
* Copyright (c) Boris-Wilfried Nyasse
* All rights reserved
*
*/
extension ExtendedString on String {
bool get isValidName {
return !contains(RegExp(r'[0–9]'));
}
}
void main() {
print('Pizza'.isValidName);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment