Filter a vector of strings by another , remove all those strings from the first vector.
int remove_if_in_list( vector<string> & vsToCheck, const vector<string> & vsList, bool bCaseSensitive = false )
number of element remains in vsToCheck.
EX1
void remove_if_in_list_ex1() { vector<string> vsToCheck ={"here","is","an","exmaple","only","for","remove_if_in_list()"}; vector<string> vsList ={"Here","is","an","exmaple"}; int nRet = remove_if_in_list(vsToCheck , vsList); if(nRet) { printf("number of element remains is %d \n" ,nRet); //Should print "only for remove_if_in_list()" for(int ii = 0; ii < vsToCheck.GetSize(); ii++) printf("%s " ,vsToCheck[ii]); } else printf("remove failed\n"); }
remove_if_not_in_list
origin.h