Returns the token to which the string tokenizer is pointing.
The string tokenizer used to split up the string.
This function returns the token to which the string tokenizer stTok, which is used to split up the string, currently points to.
In order to return a sensible value, you first must have called AdvanceToNextToken.
Keep in mind that the functions in x0_i0_stringlib are not very efficient. They do a lot of unnecessary string manipulations and unnecessary string parameter passing;
string operations and string parameter passing (into or out of nwnscript functions) are amongst the most inefficient operations in nwnscript.
For the purpose of string tokenization by the functions provided in x0_i0_stringlib, a token is any substring (including empty substrings!) within the original string enclosed by the specified delimiter (e.g. every token has one delimiter to the left, one to the right and NO delimiters within). Any non-empty original string is treated as if it were enclosed within a pair of (virtual) delimiters to its left and right. Thus, unless the original string is empty, the number of tokens is always one higher than the number of delimiters contained within the original string. A non-empty string with no delimiters therefore consists out of one token, which is equal to the original string. An empty string has no tokens, although an empty token will be returned on request.
sString = "I|am|sloppy||programmer";
sDelimiter = "|";
Token = "I";
Token = "am";
Token = "sloppy";
Token = "";
Token = "programmer";
sString contains five tokens and four delimiters.
|functions:||AdvanceToNextToken | FindSubString | GetNumberTokens | GetStringTokenizer | GetSubString | GetTokenByPosition | HasMoreTokens|
author: motu99, editor: Mistress