DEV Community

loading...

Discussion on: Daily Challenge #3 - Vowel Counter

Collapse
rvictorino profile image
Robin Victorino

Groovy has a nice built-in Pattern matcher

Integer countVowels(String text) {
    return (text =~ /(?i)[aeiou]/).size()
}
Forem Open with the Forem app