VBScript Len 函數

定義和用法

Len 函數可返回字符串中字符的數目。

語法

Len(string|varname)
參數 描述
string 字符串表達式。
varname 變量名稱。

實例

例子 1

dim txt
txt="This is a beautiful day!"
document.write(Len(txt))

輸出:

24

例子 2

document.write(Len("This is a beautiful day!"))

輸出:

24