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