Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1355
  • Last Modified:

Remove vowels from string VB.net

Hi all,

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

thanks
Zeus
0
Zeus2009
Asked:
Zeus2009
  • 2
1 Solution
 
Mike TomlinsonMiddle 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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now