'***函数说明: 删除重复项
'***参数 :
' sString : 需要删除的字符串
' sSeparator : 分隔符
'***返回值 : 去除重复项后的字符串
Function DeleteRepeat(sString, sSeparator)
Dim arrList
Dim sMyContent
Dim i, iCount
arrList = Split(sString, sSeparator)
iCount = UBound(arrList)
For i = 0 To iCount
If InStr(sMyContent & sSeparator, sSeparator & arrList(i) & sSeparator) = 0 And arrList(i) <> "" Then
sMyContent = sMyContent & sSeparator & arrList(i)
End If
Next
If sMyContent <> "" Then sMyContent = Right(sMyContent, Len(sMyContent)-1)
DeleteRepeat = sMyContent
End Function
函数调用:sResult = DeleteRepeat(sString, sSeparator)