Committed by
GitHub
GetuUtils has Uppercase/Capital letter?
Added this simple function to provide better password validation using GetUtils With this you can validate a password field combining: GetUtils.isnumericOnly(string) & GetUtils.isAlphabetOnly(string) & GetUtils.isLengthGreaterOrEqual(string); Thank you very much.
Showing
1 changed file
with
3 additions
and
0 deletions
| @@ -94,6 +94,9 @@ class GetUtils { | @@ -94,6 +94,9 @@ class GetUtils { | ||
| 94 | 94 | ||
| 95 | /// Checks if string consist only Alphabet. (No Whitespace) | 95 | /// Checks if string consist only Alphabet. (No Whitespace) | 
| 96 | static bool isAlphabetOnly(String s) => hasMatch(s, r'^[a-zA-Z]+$'); | 96 | static bool isAlphabetOnly(String s) => hasMatch(s, r'^[a-zA-Z]+$'); | 
| 97 | + | ||
| 98 | + /// Checks if string contains at least one Capital Letter | ||
| 99 | + static bool hasCapitalletter(String s) => hasMatch(s, r'[A-Z]'); | ||
| 97 | 100 | ||
| 98 | /// Checks if string is boolean. | 101 | /// Checks if string is boolean. | 
| 99 | static bool isBool(String value) { | 102 | static bool isBool(String value) { | 
- 
Please register or login to post a comment