Created
March 31, 2016 03:12
-
-
Save mrandrewmills/2a12c794bc4cbd93b2dcf5784495d002 to your computer and use it in GitHub Desktop.
case-insensitive regex that strips vowels out of a string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* disemvowel - remove vowels from a string | |
* @param {string} phrase - the string you want to "disemvowel" | |
*/ | |
function disemvowel(phrase) { | |
"use strict"; | |
return phrase.replace(/[aeiou]/ig, ""); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment