Generated readme, index and tag_database for countVowels

This commit is contained in:
Stefan Feješ
2017-12-18 20:20:24 +01:00
parent d8c41260da
commit 93096b8bdc
3 changed files with 26 additions and 0 deletions

View File

@ -110,6 +110,7 @@
* [`anagrams`](#anagrams)
* [`capitalize`](#capitalize)
* [`capitalizeEveryWord`](#capitalizeeveryword)
* [`countVowels`](#countvowels)
* [`escapeRegExp`](#escaperegexp)
* [`fromCamelCase`](#fromcamelcase)
* [`reverseString`](#reversestring)
@ -1452,6 +1453,21 @@ const capitalizeEveryWord = str => str.replace(/\b[a-z]/g, char => char.toUpperC
[⬆ back to top](#table-of-contents)
### countVowels
Retuns `number` of vowels in provided string.
Use a regular expression to count number of vowels `(A, E, I, O, U)` in a `string`.
```js
const countVowels = str =>
return (str.match(/[aeiou]/ig) || []).length;
// countVowels('foobar') -> 3
// countVowels('gym') -> 0
```
[⬆ back to top](#table-of-contents)
### escapeRegExp
Escapes a string to use in a regular expression.