c# - How to remove certain characters -


i'm trying remove single vowels string, not if vowel double same.

for example string

"i keeping foobar"

should print out

"m keepng foobr"

i have tried didn't come solution far.

try:

regex.replace(input, @"([aeiou])\1", ""); 

though i keeping foobar, give m keepng foobr, different required m keepng foobr, you're stripped spaces out of required result, too.

if want remove extraneous spaces, it's 3 step operation: remove vowels; remove proceeding/trailing spaces; remove double spaces.

var raw = regex.replace(input, @"([aeiou])\1", ""); var trimmed = raw.trim(); var final = trimmed.replace("  ", " "); 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -