#4768

xxx_pic
Member

That may use a “CutStr” function to solve the problem!

vbscript sample code:

Function CutStr(byVal Str,byVal StrLen)
Dim l,t,c,i
l=Len(str)
t=0
For i=1 To l
c=AscW(Mid(str,i,1))
If c255 Then t=t+2 Else t=t+1
IF t>=StrLen Then
CutStr=left(Str,i)&”…”
Exit For
Else
CutStr=Str
End If
Next
End Function