2.1.2.63 str_combine


Description

Combine the elements in a string vector to a new string.

Syntax

string str_combine( const vector<string> & vsSource, LPCSTR lcpszSep )

Parameters

vsSource
[Input] The string vector will be combined.
lcpszSep
[Input] The seperator string.

Return

Return the combined string.

Examples

EX1

void test_str_combine()
{
    vector<string> vsSections;
    vsSections.Add("The United States");
    vsSections.Add("China");
    vsSections.Add("Japan");
    vsSections.Add("Origin is good");
    
    string strSep = "\r\n";
    string strCombine= str_combine(vsSections,strSep);
    out_str(strCombine);
}

Remark

See Also

str_separate

Header to Include

origin.h

Reference