added AddUnique function at StringList class.

This commit is contained in:
2023-02-06 12:44:11 +08:00
parent 51c0f4ae93
commit 4b6ea7212c

View File

@@ -98,6 +98,27 @@ namespace hgl
return(count);
}
/**
* 增加一个字符串列表到当前字符串列表中,同时做去重复处理
* @param sl 要增加的字符串列表
*/
int AddUnique(const StringList<T> &sl) ///<添加字符串
{
const int count=sl.GetCount();
StringClass **str=sl.Items.GetData();
for(int i=0;i<count;i++)
{
if(Find(**str)==-1)
Add(**str);
++str;
}
return(count);
}
/**
* 清除所有字符串
*/