Control | difference | String Research 2 hours how to control output in English and Chinese in the title of the article, give everybody iron.
The function is below, and the method is:
strvalue ("Please email notification if you do not fill out the registered email", 26)
Here 26 refers to 26 English letters, which are 13 Chinese characters.
function strlen (str)
Dim P_len
P_len=0
Strlen=0
If Trim (str) <> "" Then
P_len=len (Trim (str))
For Xx=1 to P_len
If ASC (Mid (str,xx,1)) <0 Then
Strlen=int (strlen) + 2
Else
Strlen=int (strlen) + 1
End If
Next
End If
End Function
function strvalue (str,lennum)
Dim p_num
Dim i
If strlen (str) <=lennum Then
Strvalue=str
Else
P_num=0
X=0
Do, not p_num > Lennum-2
X=x+1
If ASC (Mid (str,x,1)) <0 Then
P_num=int (P_num) + 2
Else
P_num=int (p_num) + 1
End If
Strvalue=left (Trim (str), x) & "..."
Loop
End If
End Function