c# - Get rid of all vowels at the end of a string -



c# - Get rid of all vowels at the end of a string -

this have:

word = regex.replace(word, @"[aeiouyaeiouy]\z", string.empty);

but think gets rid of lastly letter (if it's vowel).

so jrhyui homecoming jrhyu whereas want homecoming jrh.

you're close. [aeiouyaeiouy] character class matches one vowel. want remove all vowels end of string, match 1 or more instances of character class. can appending + @ end, so:

[aeiouyaeiouy]+\z // ^-- match single character in list 1 or more times

regex101 demo

c# regex string visual-studio-2010 replace

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -