QuickSnip LogoA light blue logo with a thunderbolt in bracketsQuickSnip

Remove Vowels from a String

Removes all vowels from a given string.

  • string
  • remove
  • vowels

Install

npx shadcn@latest add https://quicksnip.dev/r/remove-vowels-from-a-string.json

This snippet is not verified yet. Review it before use, or help verify it.

Code

function removeVowels(str) {
  return str.replace(/[aeiouAEIOU]/g, '');
}

Usage

removeVowels('Hello World'); // Returns: 'Hll Wrld'