NumTok
From Liberty Unleashed Wiki
This function returns the number of tokens found in a string.
Syntax
integer NumTok( String string, String separator )
Arguments
- string - The string to search the token in
- separator - The separator which will be counted in the string
Example
This command returns how many spaces a player used in a command.
function onPlayerCommand( plr, cmd, text ) { if ( cmd == "spaces" ) { if ( text ) { MessagePlayer( "Your message contained " + NumTok( text, " " ) + " spaces.", plr ); } } return 1; }
Notes
The function MessagePlayer, and event onPlayerCommand were used in in this example. More info about these in the corresponding pages.