sorry,上面的不完整,要是str="中國,中國,中國,美國,美國,美國,英國,英國,英國,中國,中國"就會出現 中國,美國,英國,中國,
這個對了
<%
str="中國,中國,中國,美國,美國,美國,英國,英國,英國,中國,中國"
tmp=split(str,",")
str1=""
for i=0 to ubound(tmp)
if instr(str1,tmp(i))=0 then
str1=str1&tmp(i)&","
end if
next
response.write str1%>
先把數組拆,然後比較重組
<%
str="中国,中国,中国,英国,英国"
tmp=split(str,",")
tmp1=""
for i=0 to ubound(tmp)
if tmp(i)<>tmp1 then
str1=str1&tmp(i)&","
end if
tmp1=tmp(i)
next
response.write str1%>