get_str_from_str_list

 

Description

Get a specified index string from the string list separated by delimiter .

Syntax

string get_str_from_str_list( LPCSTR lpcszList, string strDelimiter, uint nIndex = 0 )

Parameters

lpcszList
[input] a string for searching
strDelimiter
[input] Delimiter of the two string. Only contents a charactor.
nIndex
[input] specify which string to be retrieve. Default is zero.

Return

a corresponding string which is got from the string list for nIndex

Examples

EX1

int get_str_from_str_list_ex1()
{
    string strList ="Confucius\\Mencius\\someone";
    string strDelimiter="\\";
    uint nIndex = 1;
    string strResult;
    strResult = get_str_from_str_list(strList, strDelimiter, nIndex);
    printf("index %d string (based from 0) in string list is %s\n", nIndex , strResult);
    return 0;
}

Remark

See Also

header to Include

origin.h

Reference