GetNumTokens
Return the number of tokens in this string where a token is separated by the delimiter specified by chDelimiter.
int GetNumTokens( char chDelimiter = 0 )
The number of tokens in this string.
EX1
void string_GetNumTokens_ex1() { string str1("apples peaches pumpkins"); int nRet = str1.GetNumTokens(); //default chDelimiter is whitespace out_int("", nRet);//3 string str2("apples,peaches,pumpkins"); nRet = str2.GetNumTokens(','); out_int("", nRet);//3 }
This member function returns the number of tokens in this 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::GetToken, string::GetTokens
origin.h