文字列のバイト数を返す

'===============================================================
'機能 :文字列のバイト数を返す
'引数 :objValue チェック対象文字
'戻り値:バイト数
'===============================================================
Public Function vbLeftB(ByVal strValue As String) As Integer

Dim SJIS As System.Text.Encoding = System.Text.Encoding.GetEncoding("shift-jis")

Dim strByteChar() As Byte

strByteChar = SJIS.GetBytes(strValue)

vbLeftB = strByteChar.Length()

End Function