remove_repeat_item

 

Contents

Description

Remove the repeat items in a string list

Syntax

void remove_repeat_item( vector<string> & vsList, bool bRemoveEmpty = true, bool bCaseSensitive = false )

Parameters

vsList
[modify]string list to be removed out duplicate strings
bRemoveEmpty
[input] empty string will be removed as well if true
bCaseSensitive
[input] true if string comparison is case sensitive

Return

Examples

EX1

int remove_repeat_item_ex1()
{
    vector<string> vsPlaces = {"Guangzhou", "ChaoZhou", "", "Shantou", "Raoping", "Huanggang", "Shantou", "Shanxia"};
    remove_repeat_item(vsPlaces);
    for( int ii=0; ii<vsPlaces.GetSize(); ii++)
        printf("place: %s\n",vsPlaces[ii]);
    return 0;
}

Remark

See Also

header to Include

origin.h

Reference