operator <= method
Determine the given String is matched by applying comparison staregy from OSString.
OSString foo = OSString.allCapital("Sample Text");
print(foo <= "Sample Text"); // true
print(foo <= "SAMPLE TEXT"); // true
print(foo <= "sample text"); // false
OSString bar = OSString.caseSensitive("Sample Text");
print(bar <= "Sample Text"); // true
print(bar <= "SAMPLE TEXT"); // false
print(bar <= "sample text"); // false
Implementation
bool operator <=(String str) {
return <String>{
_str,
toCaseAppliedString(),
}.any((notation) => notation == str);
}