I am trying to strip vowels in a string. I know I should be using str.replace
but I am baffled on how to get it into a span.
This is more of less what i am looking to do:
Write a JavaScript function that takes in a string s
and returns the string which is equivalent to s
but with all ASCII vowels removed. EX: (“Hello World”)
returns: "Hll wrld"
Please help!
Core Java bootcamp program with Hands on practice Similarly, the following expression matches all the consonants in the given input string. "([^aeiouyAEIOUY0-9\W]+)"; Then you can remove the matched characters by replacing them with the empty string “”, using the replaceAll() method.
.replace(/[aeiou]/ig,'')
is all you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With