Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: VB.net Vowels

  1. #1
    New Coder
    Join Date
    Oct 2011
    Posts
    92
    Thanks
    38
    Thanked 0 Times in 0 Posts

    VB.net Vowels

    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.
    Last edited by hans_cellc; 03-23-2012 at 03:12 PM.

  • #2
    New Coder
    Join Date
    Oct 2011
    Posts
    92
    Thanks
    38
    Thanked 0 Times in 0 Posts
    Meaning?

  • #3
    Regular Coder
    Join Date
    May 2007
    Location
    UK
    Posts
    180
    Thanks
    0
    Thanked 18 Times in 18 Posts
    Here's one way, using regular expressions...
    Code:
    
    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

  • #4
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •