VB School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB Expert!

Join 306,822 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,768 people online right now. Registration is fast and FREE... Join Now!




Searching a string for vowels

 

Searching a string for vowels, A program that will accept string input from the user. the program wil

wanklik

5 Jun, 2009 - 11:26 PM
Post #1

New D.I.C Head
*

Joined: 5 Jun, 2009
Posts: 5


My Contributions
A program that will accept string input from the user. the program will determin the number of vowel character(s) in a string and convert it * symbol.

User is offlineProfile CardPM
+Quote Post


firebolt

RE: Searching A String For Vowels

5 Jun, 2009 - 11:34 PM
Post #2

D.I.C Lover
Group Icon

Joined: 20 Feb, 2009
Posts: 5,475



Thanked: 77 times
Dream Kudos: 1675
My Contributions
Post your question in the body and not the description field please.
Also, could we see the code that you are working on and could you post it like so code.gif
User is online!Profile CardPM
+Quote Post

vb5prgrmr

RE: Searching A String For Vowels

6 Jun, 2009 - 06:11 PM
Post #3

D.I.C Regular
***

Joined: 21 Mar, 2009
Posts: 486



Thanked: 30 times
My Contributions
In VB's help, look up the following...

Instr
Mid
Replace

Good Luck


User is offlineProfile CardPM
+Quote Post

wanklik

RE: Searching A String For Vowels

8 Jun, 2009 - 01:38 AM
Post #4

New D.I.C Head
*

Joined: 5 Jun, 2009
Posts: 5


My Contributions
thanks....
User is offlineProfile CardPM
+Quote Post

HyFlaZher

RE: Searching A String For Vowels

15 Jun, 2009 - 08:40 PM
Post #5

New D.I.C Head
*

Joined: 13 Mar, 2009
Posts: 6


My Contributions
QUOTE(wanklik @ 5 Jun, 2009 - 11:26 PM) *

A program that will accept string input from the user. the program will determin the number of vowel character(s) in a string and convert it * symbol.


Here is a my simple code:

CODE


Private Sub Command1_Click()
Dim vowels As Integer, x As Integer
Dim c As String, ss As String 'ss the output string

x = 0
Do While x < Len(Text1.Text)
    
    c = Mid(Text1.Text, x + 1, 1) 'Get a character
    
    If LCase(c) = "a" Or LCase(c) = "e" Or _
       LCase(c) = "i" Or LCase(c) = "o" Or _
       LCase(c) = "u" Then
        
        vowels = vowels + 1
        
    End If
    
    x = x + 1
Loop

ss = Replace(Text1.Text, "A", "*")
ss = Replace(ss, "A", "*")
ss = Replace(ss, "a", "*")
ss = Replace(ss, "E", "*")
ss = Replace(ss, "e", "*")
ss = Replace(ss, "I", "*")
ss = Replace(ss, "i", "*")
ss = Replace(ss, "O", "*")
ss = Replace(ss, "o", "*")
ss = Replace(ss, "U", "*")
ss = Replace(ss, "u", "*")

End Sub


User is offlineProfile CardPM
+Quote Post

NoBrain

RE: Searching A String For Vowels

16 Jun, 2009 - 12:11 AM
Post #6

D.I.C Lover
Group Icon

Joined: 25 Mar, 2009
Posts: 1,213



Thanked: 39 times
Dream Kudos: 125
My Contributions
hmm i gues that is good but textbox has a property name PasswordChar may be that can help tongue.gif and i gues it is faster to put just * in there tongue.gif

This post has been edited by NoBrain: 16 Jun, 2009 - 12:12 AM
User is offlineProfile CardPM
+Quote Post

born2c0de

RE: Searching A String For Vowels

16 Jun, 2009 - 03:15 AM
Post #7

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 4,550



Thanked: 98 times
Dream Kudos: 2825
Expert In: J2ME, 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
Edited Topic Title to be more descriptive.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/20/09 10:29PM

Live VB Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month