用这个函数:
<%
'*************************************************
'作 者:渝满江城
'博 客:http://Jclman.bokee.com
'注 释:str----原字符串 strlen ----截取长度
'*************************************************
function GetString(str,strlen)
if str="" then
GetString=""
exit function
end if
dim l,t,c, i
str=replace(replace(replace(replace(str," "," "),""",chr(34)),">",">"),"<","<")
l=len(str)
t=0
for i=1 to l
c=Abs(Asc(Mid(str,i,1)))
if c>255 then
t=t+2
else
t=t+1
end if
if t>=strlen then
GetString=left(str,i) & "..."
exit for
else
GetString=str
end if
next
GetString=replace(replace(replace(replace(GetString," "," "),chr(34),"""),">",">"),"<","<")
end function
%>