Skip to content

Instantly share code, notes, and snippets.

@mrandrewmills
Created March 31, 2016 03:12
Show Gist options
  • Save mrandrewmills/2a12c794bc4cbd93b2dcf5784495d002 to your computer and use it in GitHub Desktop.
Save mrandrewmills/2a12c794bc4cbd93b2dcf5784495d002 to your computer and use it in GitHub Desktop.
case-insensitive regex that strips vowels out of a string
/**
* 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