久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      asp獲取字符長度函數(shù)和截取字符串函數(shù)(可以測試1個漢字占兩個字符長度)

      本文章講的是asp獲取字符長度函數(shù)和截取字符串函數(shù)(可以測試1個漢字占兩個字符長度),具體代碼如下:

      測試字符串長度

      Function CheckStringLength(txt)
      txt=trim(txt)
      x = len(txt)
      y = 0
      for ii = 1 to x
      if asc(mid(txt,ii,1)) < 0 or asc(mid(txt,ii,1)) >255 then ‘如果是漢字
      y = y + 2
      else
      y = y + 1
      end if
      next
      CheckStringLength = y
      End Function

      截取字符串
      function InterceptString(txt,length)
      txt=trim(txt)
      x = len(txt)
      y = 0
      if x >= 1 then
      for ii = 1 to x
      if asc(mid(txt,ii,1)) < 0 or asc(mid(txt,ii,1)) >255 then ‘如果是漢字
      y = y + 2
      else
      y = y + 1
      end if
      if y >= length then
      txt = left(trim(txt),ii) ‘字符串限長
      exit for
      end if
      next
      InterceptString = txt
      else
      InterceptString = “”
      end if
      End Function

       

      分享到: 更多

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號