View Single Post
  #3  
Old 02-05-2014, 11:51 PM
iDigzy iDigzy is offline
Registered User
Join Date: Apr 2013
Posts: 44
iDigzy is on a distinguished road
Quote:
Originally Posted by Torankusu View Post
obj.tokenize([delimiters]) - splits the string into an array wherever the delimiters occur

Example:
Player chats: "This is an example"

PHP Code:
player.chat.tokenize(" "); //uses spaces as separator 
Can access tokens like this:
tokenscount (will yield 4)
tokens[0] will reference the first token (the word "this").
Similarly,
tokens[2] will reference the word "an".
Thanks , would you use tokenizeing as well when doing such scripts as
PHP Code:
if (player.chat.starts("text")){ 
player.chat.substring;

?
Also, for the delimiters, you would basically be able to put for example a word such as "idigzy" and wherever that word occurs it splits it :o?
__________________
Reply With Quote