Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 610 Bytes

vowel-count.md

File metadata and controls

23 lines (15 loc) · 610 Bytes

Vowel Count 7 Kyu

LINK TO THE KATA - STRINGS FUNDAMENTALS

Description

Return the number (count) of vowels in the given string.

We will consider a, e, i, o, u as vowels for this Kata (but not y).

The input string will only consist of lower case letters and/or spaces.

Solution

const onlyVowelsRegex = new RegExp(/[^aeiou]+/, 'gi')

const getCount = string => string.replace(onlyVowelsRegex, '').length