触摸屏租赁
Touch screen rental
广告机租赁
Advertising rental
机器人租赁
Robot leasing
 当前位置:首页 > 全部 > ASP怎样将一串字符中的相同的字符过滤掉?

ASP怎样将一串字符中的相同的字符过滤掉?
<%
dim str
str="好好学习天天向上好好学习天天向上课"
function c(str)
dim str1
str1=mid(str,1,1)
for i=1 to len(str)
 t=mid(str,i,1)
 if check(t,str,str1) then
   str1=str1+t
 end if
next
c=str1
end function
function check(t,str,str1)
dim ii,i
ii=0
for i=1 to len(str)
 if t=mid(str,i,1) then
    ii=ii+1
 end if   
next
if ii=1 then '--只出现了一次
  check=true
else '--出现了多次
  if str1<>"" then
     if instr(str1,t)>0 then
     check=false
     else
     check=true
     end if
  end if
end if
end function
response.write str
response.write "<hr>"
response.write c(str)
%>


工作室地址:重庆石桥铺电脑城B座 | 微信:z35544216 | 网址:www.35544216.com