Game Accessibility Library logo SourceForge.net Logo
Game Accessibility Suite: CATString::PullNextToken
bool CATString::PullNextToken ( CATString token,
const CATString splitTokens 
)

PullNextToken() retrieves the next token from a string.

Finds the first instance of any of the characters in 'splitTokens'. Then, sets "token" to be everything to the left of that char. The string object becomes everything to the right of the char. If no more tokenizers remain in the string, then the command returns false and any remaining string is placed into 'token', and the string is left empty.

example: CATString test = "Beer:Whiskey!Sex"; CATString token;

while (!test.IsEmpty()) { if (!test.PullNextToken(token,":!")) printf("(Last token....)\n"); printf("%s\n",(const char*)token); }

Output: Beer Whiskey (Last token....) Sex

Definition at line 1587 of file CATString.cpp.

References CATASSERT, fAsciiLocked, fStrLen, fUnicodeBuffer, GetWChar(), Left(), LengthCalc(), Right(), and Trim().


Generated on Mon Feb 11 04:11:03 2008 for Game Accessibility Suite by doxygen 1.5.4