String Tokenizer

Bryan

Freshman
Joined
Jun 17, 2002
Messages
49
Location
Cedar Hill, TX
OK, here's the deal.

I know in Java there is the String Tokenizer class. This allows you to divide up a string into a series of tokens using the methods in the class.

Say if you had the string NAME with a value of "John Q Doe". Now if I want to split up this string using the normal methods builtin to VB into 3 strings (FirstName, MiddleInitial, and LastName) it would take a lot of coding.

The string tokenizer class in java would basically do this automatically

I would use the gettoken method and easily divide up the NAME string into the other strings. It would look something like this:
Visual Basic:
FirstName = gettoken(NAME)
MiddleInitial = gettoken(NAME)
LastName = gettoken(NAME)
each time you invoke the gettoken method it would return the current token and load the next token. It would keep doing this until the method returns a null value that way you know that there are no more tokens in the string.

Does anybody know of a class similar to this and if so, where can I get it?
 
Back
Top