<%
str="002;bb;/001;aa;/003;cc;/"
tmp=""
tmp1=split(str,"/")
for k=0 to ubound(tmp1)
for i=0 to ubound(tmp1)-1
if (tmp1(i))>= (tmp1(i+1)) then '如果这里为>则是从小到排,如果是<则是从大到小排
tmp=tmp1(i+1)
tmp1(i+1)=tmp1(i)
tmp1(i)=tmp
end if
next
next
str1=""
for j=0 to ubound(tmp1)
str1=str1&tmp1(j)&"/"
next
str1=right(str1,len(str1)-1)
response.write ("原字串为:" & str & "<br>从小到大:" & str1)
%>
数组排序
最新推荐文章于 2022-11-15 21:01:18 发布