日期:2014-05-16 浏览次数:21183 次
str="1,3,2,1,2,3"
ar = split(str,"2")
str2 = ""
for i=0 to ubound(ar)
str2 = str2 & ar(i)
if i<>0 and i<>ubound(ar) then
str2 = str2 & "2"
end if
next
str2 = replace(str2, ",,",",")
<%
Function fun(arr,n)
Dim s_arr,i,list
s_arr=Split(arr,",")
For i=0 To UBound(s_arr)
If i<>n Then
list=list&","&s_arr(i)
End If
Next
fun=Mid(list,2)
End Function
Response.write fun("1,3,2,1,2,3",2) '删除逗号后第2个的字符 返回1,3,1,2,3
Response.write fun("1,3",2) '删除逗号后第2个的字符 返回1,3
%>