問題解決了
Function ZW(A)
For i = 1 To Len(A)
If LenB(StrConv(Mid(A, i, 1), &H80)) = 2 Then
zw2 = zw2 & Mid(A, i, 1)
End If
Next i
ZW = zw2
End Function
還是要謝謝你作者: ML089 時間: 2013-8-9 10:37
Function ZW(A)
For i = 1 To Len(A)
If LenB(StrConv(Mid(A, i, 1), &H80)) = 2 Then
zw2 = zw2 & Mid(A, i, 1)
End If
Next i
ZW = zw2
End Function
拿掉 StrConv 函數如下,執行就不對,WHY?
Function ZW1(A)
ZW = ""
For i = 1 To Len(A)
If LenB(Mid(A, i, 1)) = 2 Then
ZW = ZW & Mid(A, i, 1)
End If
Next i
End Function作者: mhl9mhl9 時間: 2013-8-10 00:49
Function LenMbcs(ByVal str As String)
LenMbcs = LenB(StrConv(str, vbFromUnicode))
End Function
Sub yyy()
a = LenMbcs("劉abc")
End Sub
a=5------(2+3)作者: ML089 時間: 2013-8-10 19:30