asp下去除数组中重复的项的方法 |
本文标签: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 %> |