婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > asp 數組 重復刪除函數(腳本之家增強版)

asp 數組 重復刪除函數(腳本之家增強版)

熱門標簽:長沙防封電銷卡品牌 地圖標注服務哪家好 西寧公司外呼系統平臺 地圖標注宅基地 武漢營銷電話機器人軟件 智能電銷機器人適用于哪些行業 外呼系統還用卡么 騰訊地圖標注商戶關閉 徐州人工智能電銷機器人好用嗎

因為要寫個東西用到,所以百度了一下,居然有朋友亂寫,而且比較多,都沒有認真測試過,只對字符可以,但是對數字就不可以,而且通用性很差,需要修改才可以真正使用。沒辦法就自己寫了,經過測試完全沒有問題,而且思路很方便,代碼很短,如下:

復制代碼 代碼如下:

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

使用方法和函數表示:
1、cxarraynull(cxstr1,cxstr2)函數中的兩個參數:
cxstr1:要檢測的數組變量,可以為空,或其它未知的錯誤數據,當為空或則為錯誤數據返回"nodate"。
cxstr2:數組的分割符號,可以為空,或為chr(13)等,自動替換輸出。
2、測試代碼:
%
s="1,2,3,4,2,3,5,3"
s=cxarraynull(s,",")
response.write s
%>
輸出:1,2,3,4,5


腳本之家增強版本,解決了數組中最后一位的,逗號問題。
復制代碼 代碼如下:

%
function cxarraynull(cxstr1,cxstr2)
if isarray(cxstr1) then
cxarraynull = "對不起,參數1不能為數組"
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 = cxstr2ss(0)cxstr2
sss = cxs
for m = 0 to ubound(ss)
cc = cxstr2ss(m)cxstr2
if instr(sss,cc)=0 then
sss = sssss(m)cxstr2
end if
next
cxarraynull = right(sss,len(sss) - len(cxstr2))
cxarraynull = left(cxarraynull,len(cxarraynull) - len(cxstr2))
end function
%>

測試代碼:
復制代碼 代碼如下:

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

您可能感興趣的文章:
  • asp取得數組中的最大值的方法
  • asp下使用數組存放數據的代碼
  • asp 得到動態數組中元素的個數
  • asp.net 數組中字符串替換的幾種方式
  • asp 動態數組 提供Add、Insert、Remove、RemoveAt、Search等方法。
  • asp.net 字符串、二進制、編碼數組轉換函數
  • asp.net通過js實現Cookie創建以及清除Cookie數組的代碼
  • asp textarea 多行數組分割處理方法
  • ASP 過濾數組重復數據函數(加強版)
  • ASP 使用Filter函數來檢索數組的實現代碼
  • asp數組的使用介紹
  • Asp與JS的數組和字符串下標介紹
  • asp中使用redim、preserve創建動態數組實例
  • ASP定義數組方法的技巧

標簽:通化 通遼 運城 鷹潭 巴彥淖爾 普洱 荊門 雅安

巨人網絡通訊聲明:本文標題《asp 數組 重復刪除函數(腳本之家增強版)》,本文關鍵詞  asp,數組,重復,刪除,函數,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《asp 數組 重復刪除函數(腳本之家增強版)》相關的同類信息!
  • 本頁收集關于asp 數組 重復刪除函數(腳本之家增強版)的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 惠安县| 喀什市| 宜宾县| 宁城县| 汤阴县| 德格县| 山东省| 武义县| 拜城县| 韶山市| 聂荣县| 南乐县| 葵青区| 孟村| 抚宁县| 土默特左旗| 谷城县| 洛阳市| 湖北省| 长兴县| 略阳县| 奈曼旗| 军事| 那坡县| 南宫市| 青铜峡市| 壤塘县| 象山县| 和田县| 新蔡县| 林口县| 固安县| 谷城县| 宁海县| 得荣县| 望城县| 长治市| 含山县| 洛川县| 开封市| 鄂托克前旗|