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
posted @ 2012-04-08 11:53  高级测试开发网  阅读(529)  评论(0编辑  收藏  举报
了解开发资源最新动态:https://seniortesting.club