isMixedCase method
Checks whether the String
is consisted of both upper and lower case letters.
Example
String foo = 'Hello World';
bool isMixedCase = foo.isMixedCase; // returns true;
String foo = 'hello world';
bool isMixedCase = foo.isMixedCase; // returns false;
Implementation
bool isMixedCase() {
if (this.isBlank) {
return false;
}
return this.toUpperCase() != this && this.toLowerCase() != this;
}