Last active
January 24, 2022 04:24
-
-
Save bwnyasse/3697fa4ed500456b6774e4f510cc6195 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
/* | |
* 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