Generated readme, index and tag_database for countVowels
This commit is contained in:
16
README.md
16
README.md
@ -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.
|
||||
|
||||
Reference in New Issue
Block a user