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
%>
« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3