Public Function GetString(str, strlen)
Dim l, t, c, i
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
End Function
Dim l, t, c, i
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
End Function