<dfn id="w48us"></dfn><ul id="w48us"></ul>
  • <ul id="w48us"></ul>
  • <del id="w48us"></del>
    <ul id="w48us"></ul>
  • asp數(shù)組重復刪除函數(shù)

    時間:2024-09-01 15:13:48 ASP 我要投稿
    • 相關推薦

    asp數(shù)組重復刪除函數(shù)

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

      復制代碼 代碼如下:

      <%

      function cxarraynull(cxstr1,cxstr2)

      if isarray(cxstr1) then

      cxarraynull = "對不起,參數(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ù)中的兩個參數(shù):

      cxstr1:要檢測的數(shù)組變量,可以為空,或其它未知的錯誤數(shù)據(jù),當為空或則為錯誤數(shù)據(jù)返回"nodate"。

      cxstr2:數(shù)組的分割符號,可以為空,或為chr(13)等,自動替換輸出。

      2、測試代碼:

      <%

      s="1,2,3,4,2,3,5,3"

      s=cxarraynull(s,",")

      response.write s

      %>

      輸出:1,2,3,4,5

      增強版本,解決了數(shù)組中最后一位的,逗號問題。

      復制代碼 代碼如下:

      <%

      function cxarraynull(cxstr1,cxstr2)

      if isarray(cxstr1) then

      cxarraynull = "對不起,參數(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

      %>

      測試代碼:

      復制代碼 代碼如下:

      s="1,2,3,4,55,55,55,333,333,2,3,5,3,88,,,,,,,66,,66,,,,,,,,,,,,,,,,,,,,,,,,"

      s=cxarraynull(s,",")

      response.write s

    【asp數(shù)組重復刪除函數(shù)】相關文章:

    php數(shù)組函數(shù)序列之a(chǎn)rray-combine() - 數(shù)組合并函數(shù)的代碼08-25

    關于asp 的常用函數(shù)用法10-11

    解讀Rnd 函數(shù)中的asp08-03

    ASP.NET Page函數(shù)調(diào)用解析10-01

    防盜鏈接ASP函數(shù)實現(xiàn)代碼01-23

    JavaScript數(shù)組常用方法介紹09-04

    Excel高手武器:數(shù)組基礎08-08

    word批注刪除方法10-03

    ASP提速技巧08-05

    重復法翻譯09-12

    主站蜘蛛池模板: 青青青国产精品国产精品久久久久| 久久青青草原国产精品免费| 国产精品1区2区| 亚洲av午夜成人片精品电影| 91精品成人免费国产片| 国产综合色在线精品| 香蕉依依精品视频在线播放 | 亚洲电影日韩精品| 国产精品成人一区二区| 九九热在线精品视频| 久久国产免费观看精品3| 亚洲精品永久在线观看| 精品久久久久久久久久久久久久久 | 久久精品免费大片国产大片| 精品久久久久久亚洲| 国产精品国产三级国产普通话| 青草国产精品久久久久久| 一本色道久久综合亚洲精品| 网友偷拍日韩精品 | 国内精品久久久久久久coent| 亚洲午夜精品一区二区| 四虎国产成人永久精品免费| 日韩精品中文字幕第2页| 精品久久久无码中文字幕天天 | 亚洲精品狼友在线播放| 亚洲精品456播放| 亚洲国产精品日韩专区AV| 国产在视频线精品视频二代| 国产免费伦精品一区二区三区| 国产成人精品免费午夜app| AAA级久久久精品无码片| 国产精品亚洲日韩欧美色窝窝色欲| 久久免费的精品国产V∧| 精品一区二区三区免费毛片爱| 日韩人妻精品一区二区三区视频| 一本色道久久综合亚洲精品| 亚洲精品无码mv在线观看网站| 无码人妻精品一区二区三区东京热| 四虎影视永久在线精品| 永久免费精品影视网站| 久久久无码精品亚洲日韩蜜臀浪潮 |