ASP截取字数(二)
function StrLeft(Str,StrLen) dim L,T,I,C if Str="" then StrLeft="" exit function end if Str=Replace(Replace(Replace(Replace(Str," "," "),""",Chr(34)),">",">"),"<","<") 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," "," "),Chr(34),"""),">",">"),"<","<") end function