GetToken
This member function returns the token at nToken index in a string where a token is separated by the delimiter specified by chDelimiter.
string GetToken( int nToken, char chDelimiter = 0 )
The extracted string token.
EX1
void string_GetToken_ex1() { string str1("apples peaches pumpkins"); string str3("apples,peaches,pumpkins"); string str2=str1.GetToken(1); out_str(str2);//peaches string str4=str3.GetToken(2,','); out_str(str4);//pumpkins }
This member function returns the token at nToken index in a string where a token is separated by the delimiter specified by chDelimiter. Default is 0 (null constant) so chDelimiter does not have to be specified when any white space (space, tab, newline, etc.) is to be used as the delimiter.
string::GetNumTokens, string::GetTokens
origin.h