string::SetTokens

Description

Copy a StringArray into this string and separate them with specified delimiter

Syntax

int SetTokens( StringArray & saTokens, char chDelimiter = '\t' )

Parameters

saTokens
[input] string array containing the tokens
chDelimiter
[input]character to use as the delimiter

Return

Number of tokens in this string, -1 for error

Examples

EX1

void string_SetTokens_ex1()
{
        StringArray saColors = {"red", "green", "blue"};
        string strColors;
        strColors.SetTokens(saColors, '|');
        out_str(strColors);//"red|green|blue"
}

Remark

See Also

string::GetNumTokens, string::GetTokens

header to Include

origin.h