Function MySubString(ByVal strSource)
Dim intLoop
Dim blnIsNumber
Dim strOnBit
MySubString = ""
blnIsNumber = 0
For intLoop=1 To Len(strSource)
strOnBit = Mid(strSource, intLoop, 1)
If IsNumeric(strOnBit)=False Then
If blnIsNumber Then
Exit Function
End If
Else
blnIsNumber = True
End If
MySubString = MySubString & strOnBit
Next
End Function
'函数名:SubstZFC
'作 用:截字符串,汉字一个算两个字符,英文算一个字符
'参 数:str ----原字符串
' strlen ----截取长度
'返回值:截取后的字符串
'**************************************************
Public Function SubstZFC(ByVal str, ByVal strlen)
If str = "" Then
SubstZFC = ""
Exit Function
End If
Dim l, t, c, i, strTemp
str = Replace(Replace(Replace(Replace(str, " ", " "), """, Chr(34)), ">", ">"), "<", "<")
l = Len(str)
t = 0
strTemp = str
strlen = CLng(strlen)
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
strTemp = Left(str, i)
Exit For
End If
Next
If strTemp <> str Then
strTemp = strTemp & "…"
End If
SubstZFC = Replace(Replace(Replace(Replace(strTemp, " ", " "), Chr(34), """), ">", ">"), "<", "<")
End Function