1. Purely intercepting strings
CopyCode The Code is as follows: function cutstr (thestr1, strlen)
Dim L, T, C
L = Len (thestr1)
If l <1 then exit function
T = 0
For dxy1 = 1 to L
C = ABS (ASC (mid (thestr1, dxy1, 1 )))
If C & gt; 255 then
T = T + 2
Else
T = t + 1
End if
If T> = strlen then
Thev = mid (thestr1, 1, dxy1)
Exit
Else
Thev = thestr1
End if
Next
Cutstr = thev
End Function
2. truncate the string. If it is not enough, use spaces to fill it up.Copy codeThe Code is as follows: function cutstr (thestr, strlen)
Dim L, T, C
L = Len (thestr)
T = 0
For dxy = 1 to L
C = ABS (ASC (mid (thestr, dxy, 1 )))
If C & gt; 255 then
T = T + 2
Else
T = t + 1
End if
If T> = strlen then
Thev = left (thestr, dxy)
Exit
Else
Bu = strlen-T
For Bui = 1 to Bu
Strbu = ""
Strbuall = strbuall & strbu
Next
Thev = thestr & strbuall
Strbu = ""
Strbuall = ""
End if
Next
Cutstr = thev
End Function