Len Function

傳回字串中的字元數,或儲存變數所需的位元組數。

語法


Len(Text As String)

傳回值類型

Long

參數:

Text:任意字串型表示式或其他類型的變數。

錯誤代碼:

5 無效的程序呼叫

示例:


Sub ExampleLen
Dim sText as String
    sText = "Las Vegas"
    MsgBox Len(sText) ' 9
End Sub

Please support us!