vowelCount method

int vowelCount()

Get the number of vowels in a string.

Implementation

int vowelCount() {
  if (this == null) {
    throw ArgumentError('string: $this');
  }
  if (this!.isEmpty) {
    return 0;
  }
  return this!.toLowerCase().split(RegExp(r'[aeiou]')).length - 1;
}