Searching a string for vowels
Page 1 of 1
Searching a string for vowels A program that will accept string input from the user. the program wil
#5
Posted 15 June 2009 - 08:40 PM
wanklik, on 5 Jun, 2009 - 11:26 PM, said:
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:
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
Page 1 of 1

Start a new topic
Add Reply




MultiQuote



| 


