isAnyCaseLetter property
bool
get
isAnyCaseLetter
Checks if the string contains only letters, regardless of case (a-z, A-Z).
This method uses a regular expression to check if all characters in the string are alphabetic characters, either lowercase or uppercase. It does not consider numbers, symbols, or whitespace as letters.
Returns:
true
if the string consists entirely of alphabetic characters, false
otherwise.
Returns false
for empty strings.
Example:
'LettersOnly'.isAnyCaseLetter; // Returns true
'mixedCASE'.isAnyCaseLetter; // Returns true
'123Letters'.isAnyCaseLetter; // Returns false
''.isAnyCaseLetter; // Returns false
NOTE: supports unicode
Implementation
bool get isAnyCaseLetter => RegExp(r'^[\p{L}]+$', unicode: true).hasMatch(this);