VBScript Len 函數(shù)
定義和用法
Len 函數(shù)可返回字符串中字符的數(shù)目。
語(yǔ)法
Len(string|varname)
| 參數(shù) | 描述 |
|---|---|
| string | 字符串表達(dá)式。 |
| varname | 變量名稱(chēng)。 |
實(shí)例
例子 1
dim txt txt="This is a beautiful day!" document.write(Len(txt))
輸出:
24
例子 2
document.write(Len("This is a beautiful day!"))
輸出:
24