isVowel method
Returns true if this single-character string is a vowel.
Implementation
@useResult
bool isVowel() {
if (isEmpty || length != 1) {
return false;
}
return switch (toLowerCase()) {
'a' || 'e' || 'i' || 'o' || 'u' => true,
_ => false,
};
}