Thread: tokenize help
View Single Post
  #6  
Old 08-13-2001, 03:58 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
Say you have 2 strings:
setstring this.teststring,This is a test;
setstring this.teststring2,This is "a test";

Now, lets tokenize the first one:
tokenize #s(this.teststring);

This is what it returns:
#t(0) - This
#t(1) - is
#t(2) - a
#t(3) - test

Now, lets tokenize the second string:
tokenize #s(this.teststring2);

This is what it returns:
#t(0) - This
#t(1) - is
#t(2) - a test

As you can see, putting parenthesis around something tells tokenize to count everything inside the parenthesis as 1 token.

As for tokenize2, it will tokenize via space's AND the delimeters, so:

setstring this.teststring3,My computer's name is Samson;
tokenize2 s,#s(this.teststring3);

This is what it returns:
#t(0) - My
#t(1) - computer'
#t(2) - name
#t(3) - i
#t(4) - am
#t(5) - on

Hope that helps
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote