The following should give you some idea
Add a text box (text1.text) and set the caption to
"The cat sat on the MAT"
then add the following code behind a command button, when you run your project you should see a list, printed to the form, of the different characters found within the string.
Kate
Private Sub Command1_Click()
Dim c As Integer
Dim temp As String * 1
For c = 1 To Len(Text1.Text)
temp = Mid$(Text1.Text, c, 1)
Select Case temp
Case "a", "e", "i", "o", "u", "A", "E", "I", "O", "U"
'found a vowel
Print "Vowel at position " & c
Case "a" To "z"
'found a lowercase letter
Print "LowerCase letter at position " & c
Case "A" To "Z"
'found an uppercase letter
Print "UpperCase letter at position " & c
Case Space(1)
'found a space
Print "space found at position " & c
Case Else
'found something else
End Select
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.