[quote]
Originally posted by joe_bruin
now waitaminute,
is this intended as a demostration of the language, or of the api?
your function just calls another function. it doesn't really demonstrate that you are capable of finding the number of times a character appears in a string.
how about we see a reimplementation of instr() in vb instead of just calling it?
Yes it does.....the instr function is a keyword function in vb. Just like the dateadd one I posted earlier. You can use the instr function outside of another function, just take off the function:
Code:
dim strChar as String = "Johnny Boy"
dim intNum as Integer
intNum = instr(strChar, "y")
'intNum = 2
This is why I like vb so much because I don't need to write 4 or 5 lines of code to do things like this. Why re-invent the wheel.....