...

View Full Version : VB.net Vowels



hans_cellc
03-23-2012, 01:24 PM
I am playing with VB .net and want to write a small prog that will take a string and remove the vowels and place them in the order they were removed into a label.

Removing the vowel was easy with the MID but how do I store them in a variable to be used later.

This what I am trying with no success so far, PLEAZE HELP.

hans_cellc
03-23-2012, 01:56 PM
Meaning?

SouthwaterDave
03-24-2012, 04:46 PM
Here's one way, using regular expressions...


Imports System.Text.RegularExpressions

Module Module1
Sub Main()
Dim source As String = "Hello", target As String = ""

For Each m As Match In Regex.Matches(source, "[aeiou]")
target &= m.Value
Next

Console.WriteLine(target)
End Sub
End Module

ben.allen8
10-11-2012, 09:41 AM
Looking at the above code, you could make it a bit better by using sub routines and then it will be easier to do separate things in the program good luck :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum