isEnglish property

bool isEnglish

Checks if the string contains only English alphabet characters (A-Z, a-z). This can be useful for validating names or words that should not include numbers or symbols.

Example:

print('Hello'.isEnglish); // Output: true
print('Hello123'.isEnglish); // Output: false

Implementation

bool get isEnglish => RegExp(r'^[a-zA-Z]+$').hasMatch(this);