'変数宣言 Dim str As String = "" '文字の長さ(文字数)を求める str = Test.Length '文字の長さ(バイト数)を求める str = Encoding.GetEncoding(0).GetByteCount(Test.Text)