Setup
Trolls are invading the comment section!
To deal with the threat, write a function that takes a string and returns a new string with all vowels removed (y
not included).
Example
"This website is for losers LOL!"
=> "Ths wbst s fr lsrs LL"
Tests
"No newbies allowed, go to #beginners"
=>
"LULZ TROLLED"
=>
Try to keep it simple. Have fun!
This challenge comes from osuushi on CodeWars. Thank you to CodeWars, who has licensed redistribution of this challenge under the 2-Clause BSD License!
Want to propose a challenge idea for a future post? Email yo+challenge@dev.to with your suggestions!
Latest comments (15)
Liquid syntax error: Unknown tag 'def'
JS
const disemvowel = (str) => str.replace(/[aeoiu]/gi, '');
Standard ML of New Jersey Solution
Here's a Ruby submission!
Here's a link to the Repl.it: repl.it/@rburmorrison/DevToChallen...
Python solution 🐍
Elm
Example.
Python solution.
you could use
regex
to keep it simple :)I am yet to study about regexes :)
Some unfancy Common Lisp:
Ruby:
In Ts:
In C#
Or may be just
var cleaned = Regex.Replace(input,"[aeiou]", "", RegexOptions.IgnoreCase);
Nice One!