asp下去除数组中重复的项的方法

 <%
'******************************
'函数:MoveR(Rstr)
'参数:Rstr,以逗号做分隔的数组
'作者:阿里西西
'日期:2007/7/13
'描述:去除数组中重复的项
'示例:<%MoveR("abc,abc,dge,gcg,dge,dgi,die,dir,fgk,dir,gis,sgier,ssir")%>
'******************************
Function MoveR(Rstr)
 Dim i,SpStr
 SpStr = Split(Rstr,",")
 For i = 0 To Ubound(Spstr)
  If I = 0 then
   MoveR = MoveR & SpStr(i) & ","
  Else
   If instr(MoveR,SpStr(i))=0 and i=Ubound(Spstr) Then
    MoveR = MoveR & SpStr(i)
   Elseif instr(MoveR,SpStr(i))=0 Then
    MoveR = MoveR & SpStr(i) & ","
   End If
  End If
 Next
End Function 
%>
http://www.yuleweb.com/Article/web/ASP/200708/5520.html
posted on 2008-01-31 12:42  radman  阅读(682)  评论(1)    收藏  举报