Remove vowels from string VB.net

Hi all,

Can someone please provide a function that removes vowels from string.

thanks
Zeus
Zeus2009Asked:
Who is Participating?
 
Mike TomlinsonConnect With a Mentor Middle School Assistant TeacherCommented:
Seriously?...   =\

    Private Function RemoveVowels(ByVal strIn As String) As String
        For Each vowel As String In "aeiouAEIOU"
            strIn = strIn.Replace(vowel, "")
        Next
        Return strIn
    End Function
0
 
Zeus2009Author Commented:
yep lol im trying to prove a point in a meeting, thanks idel mind.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
If you have VB.Net 2008 or above then it could be written as an "Extension" method which would make it look like this instead:

    yourStringVariableHere.RemoveVowels()

See: http://msdn.microsoft.com/en-us/library/bb384936.aspx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.