Update and rename noVowels.md to removeVowels.md

This commit is contained in:
Angelos Chalaris
2018-01-09 14:20:08 +02:00
committed by GitHub
parent 1f9e139a87
commit 13b5ea7fd4
2 changed files with 14 additions and 14 deletions

View File

@ -1,14 +0,0 @@
### noVowels
Returns all the vowels in a `str` replaced by `repl`.
Skip `repl` to use a default value of `''`
```js
const noVowels = (str,repl = '') => str.replace(/[aeiou]/gi,repl)
```
```js
noVowels("foobAr"); // "fbr"
noVowels("foobAr","*"); //f**b*r
```

14
snippets/removeVowels.md Normal file
View File

@ -0,0 +1,14 @@
### removeVowels
Returns all the vowels in a `str` replaced by `repl`.
Skip `repl` to use a default value of `''`
```js
const removeVowels = (str,repl = '') => str.replace(/[aeiou]/gi,repl)
```
```js
removeVowels("foobAr"); // "fbr"
removeVowels("foobAr","*"); // "f**b*r"
```