zoukankan      html  css  js  c++  java
  • ASP截取字数(二)

    function StrLeft(Str,StrLen)
      dim L,T,I,C
      if Str="" then
        StrLeft=""
        exit function
      end if
      Str=Replace(Replace(Replace(Replace(Str,"&nbsp;"," "),"&quot;",Chr(34)),"&gt;",">"),"&lt;","<")
      L=Len(Str)
      T=0
      for i=1 to L
        C=Abs(AscW(Mid(Str,i,1)))
        if C>255 then
          T=T+2
        else
          T=T+1
        end if
        if T>=StrLen then
          StrLeft=Left(Str,i) & ""
          exit for
        else
          StrLeft=Str
        end if
      next
      StrLeft=Replace(Replace(Replace(replace(StrLeft," ","&nbsp;"),Chr(34),"&quot;"),">","&gt;"),"<","&lt;")
    end function
  • 相关阅读:
    密码学基础(三)
    密码学基础(二)
    密码学基础(一)
    Lambda代数
    恢复系统
    11.22面试例题
    js中级复习
    11.12
    11.13
    定时器
  • 原文地址:https://www.cnblogs.com/liuswi/p/2754628.html
Copyright © 2011-2022 走看看