ASP截取字数(一)
function StrLen(Str) if Str="" or isnull(Str) then StrLen=0 exit function else dim regex set regex=new regexp regEx.Pattern ="[^\x00-\xff]" regex.Global =true Str=regEx.replace(Str,"^^") set regex=nothing StrLen=len(Str) end if end function
注:[^\x00-\xff]:匹配双字节字符(包括汉字在内)