Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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:

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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...