国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

服務(wù)器之家:專注于服務(wù)器技術(shù)及軟件下載分享
分類導(dǎo)航

PHP教程|ASP.NET教程|Java教程|ASP教程|編程技術(shù)|正則表達(dá)式|C/C++|IOS|C#|Swift|Android|VB|R語言|JavaScript|易語言|vb.net|

服務(wù)器之家 - 編程語言 - ASP教程 - asp 數(shù)組 重復(fù)刪除函數(shù)(服務(wù)器之家增強(qiáng)版)

asp 數(shù)組 重復(fù)刪除函數(shù)(服務(wù)器之家增強(qiáng)版)

2019-09-03 11:31腳本之家 ASP教程

這篇文章是asp下刪除重復(fù)數(shù)組的函數(shù),已經(jīng)經(jīng)過測(cè)試。

因?yàn)橐獙憘€(gè)東西用到,所以百度了一下,居然有朋友亂寫,而且比較多,都沒有認(rèn)真測(cè)試過,只對(duì)字符可以,但是對(duì)數(shù)字就不可以,而且通用性很差,需要修改才可以真正使用。沒辦法就自己寫了,經(jīng)過測(cè)試完全沒有問題,而且思路很方便,代碼很短,如下: 

復(fù)制代碼代碼如下:

<% 
function cxarraynull(cxstr1,cxstr2) 
if isarray(cxstr1) then 
cxarraynull = "對(duì)不起,參數(shù)1不能為數(shù)組" 
Exit Function 
end if 
if cxstr1 = "" or isempty(cxstr1) then 
cxarraynull = "nodate" 
Exit Function 
end if 
ss = split(cxstr1,cxstr2) 
cxs = cxstr2&ss(0)&cxstr2 
sss = cxs 
for m = 0 to ubound(ss) 
cc = cxstr2&ss(m)&cxstr2 
if instr(sss,cc)=0 then 
sss = sss&ss(m)&cxstr2 
end if 
next 
cxarraynull = right(sss,len(sss) - len(cxstr2)) 
cxarraynull = left(cxarraynull,len(cxarraynull) - len(cxstr2)) 
end Function 
%> 

使用方法和函數(shù)表示: 
1、cxarraynull(cxstr1,cxstr2)函數(shù)中的兩個(gè)參數(shù): 
cxstr1:要檢測(cè)的數(shù)組變量,可以為空,或其它未知的錯(cuò)誤數(shù)據(jù),當(dāng)為空或則為錯(cuò)誤數(shù)據(jù)返回"nodate"。 
cxstr2:數(shù)組的分割符號(hào),可以為空,或?yàn)閏hr(13)等,自動(dòng)替換輸出。 
2、測(cè)試代碼: 
<% 
s="1,2,3,4,2,3,5,3" 
s=cxarraynull(s,",") 
response.write s 
%> 
輸出:1,2,3,4,5 


服務(wù)器之家增強(qiáng)版本,解決了數(shù)組中最后一位的,逗號(hào)問題。 
復(fù)制代碼代碼如下:

<% 
function cxarraynull(cxstr1,cxstr2) 
if isarray(cxstr1) then 
cxarraynull = "對(duì)不起,參數(shù)1不能為數(shù)組" 
Exit Function 
end if 
if cxstr1 = "" or isempty(cxstr1) then 
cxarraynull = "nodate" 
Exit Function 
end if 
do while instr(cxstr1,",,")>0 
cxstr1=replace(cxstr1,",,",",") 
loop 
if right(cxstr1,1)="," then 
cxstr1=left(cxstr1,len(cxstr1)-1) 
end if 
ss = split(cxstr1,cxstr2) 
cxs = cxstr2&ss(0)&cxstr2 
sss = cxs 
for m = 0 to ubound(ss) 
cc = cxstr2&ss(m)&cxstr2 
if instr(sss,cc)=0 then 
sss = sss&ss(m)&cxstr2 
end if 
next 
cxarraynull = right(sss,len(sss) - len(cxstr2)) 
cxarraynull = left(cxarraynull,len(cxarraynull) - len(cxstr2)) 
end function 
%> 

測(cè)試代碼: 
復(fù)制代碼代碼如下:

s="1,2,3,4,55,55,55,333,333,2,3,5,3,88,,,,,,,66,,66,,,,,,,,,,,,,,,,,,,,,,,," 
s=cxarraynull(s,",") 
response.write s 

延伸 · 閱讀

精彩推薦
Weibo Article 1 Weibo Article 2 Weibo Article 3 Weibo Article 4 Weibo Article 5 Weibo Article 6 Weibo Article 7 Weibo Article 8 Weibo Article 9 Weibo Article 10 Weibo Article 11 Weibo Article 12 Weibo Article 13 Weibo Article 14 Weibo Article 15 Weibo Article 16 Weibo Article 17 Weibo Article 18 Weibo Article 19 Weibo Article 20 Weibo Article 21 Weibo Article 22 Weibo Article 23 Weibo Article 24 Weibo Article 25 Weibo Article 26 Weibo Article 27 Weibo Article 28 Weibo Article 29 Weibo Article 30 Weibo Article 31 Weibo Article 32 Weibo Article 33 Weibo Article 34 Weibo Article 35 Weibo Article 36 Weibo Article 37 Weibo Article 38 Weibo Article 39 Weibo Article 40
主站蜘蛛池模板: 看av的网址 | 成人羞羞视频免费 | 中文字幕亚洲一区二区三区 | 中文字幕专区 | 一区二区三区高清视频在线观看 | 国产毛片久久久久 | 日日骚av | 黄色网在线看 | 精品国产乱码久久久久久久 | 国产精品一区二区三区免费 | 欧美日韩在线观看视频 | 99亚洲| 国产婷婷在线观看 | 91免费看网站 | 国产一区中文字幕 | 一级高清 | 亚洲精品久久久蜜桃 | 亚洲国产精品无卡做爰天天 | 免费一二区| 国产羞羞视频免费在线观看 | 久久久久久久久久久久国产精品 | 久久免费视频观看 | 99精品视频在线观看 | 九色在线视频 | 日韩在线视频一区 | 日韩中文字幕av | 中文久久久久久 | 伊人中文字幕 | 国产精品99久久久久久久女警 | 亚洲一区二区在线播放 | 日韩在线视频观看 | 一区二区在线不卡 | 亚洲免费观看在线视频 | 欧美日韩国产精品一区 | 精品欧美乱码久久久久久1区2区 | 欧美午夜视频 | 精品国产91乱码一区二区三区 | 欧美日韩中文字幕在线 | 亚洲精品综合 | 99热a | 久久久久久久久久久精 |