VBS去除指定的字符串中的重复项返回重复后的字符串

sub replaceComon(str)
for i=1 to len(str)
tempstr=mid(str,i,1)
finalstr=""
if instr(1,finalstr,tempstr,1)>0 then '查找到了重复的字符
str=replace(str,tempstr,"")
else   '没有查找到重复的字符的时候就追加字符到新字符串中
finalstr=finalstr+tempstr

end if
next
replaceComon=finalstr
end sub
原文地址:https://www.cnblogs.com/seniortestingdev/p/2437476.html