|
-
Aug 3rd, 2000, 02:47 AM
#1
Thread Starter
Fanatic Member
Howdy,
I would like to use one of the functions such as len,mid,instr to find out the exact number of specific letters in a string.
lets say the string is "Hello, take me to your leader".
and I want to find out how many of the letters "h","t" and "a" that are in this string.
the code I tryed to use is this.
Dim M As Integer
M = 1
For M = 1 To Len(textString)
If Mid(letters, M, 1) = "h" or "t" or "a" Then
intnumletters = intnumletters + 1
End If
Next M
NumOfMyletters = intnumletters
but this gives me a type mismatch error.
if I only try to use one letter(say "h") then it works fine but when I use Or it no longer works.
any help or suggestion would be great.
thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|