![]() |
tokenize help
will tokenize2 +,blah+blah blah return
#t(0) - blah #t(1) - blah blah or will it return #t(0) - blah #t(1) - blah #t(2) - blah and if it returns the latter...how do I get it to return the former? especially if I dont know how many words will be in my string? |
what is tokenize used for?
|
Quote:
|
Quote:
and if you dont know how long ur string is then you can just do tokenscount which returns the number of tokens. |
nope dude..I tried...tokenize2 +,blah blah blah; returns
#t(0) - blah #t(1) - blah #t(2) - blah |
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 |
This is used in the guild managment NPC for kingdoms. I could look at the version i have. if i wasnt so lazy.
|
Quote:
|
Xaviar, that name reminds me of Kaviar.
|
I think you mean Caviar...and you would be the third person to say that
|
base
|
| All times are GMT +2. The time now is 11:46 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.