Create noVowels.md
This commit is contained in:
14
snippets/noVowels.md
Normal file
14
snippets/noVowels.md
Normal file
@ -0,0 +1,14 @@
|
||||
### 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
|
||||
```
|
||||
Reference in New Issue
Block a user