VBScript Len function
Len function returns the number of characters in a string.
grammar
Len(string)
参数 | 描述 |
---|---|
string | 字符串表达式。 |
Examples
Example 1
<script type="text/vbscript">
txt="This is a beautiful day!"
document.write(Len(txt))
</script>
txt="This is a beautiful day!"
document.write(Len(txt))
</script>
Examples of the above output:
24
try it"
Example 2
You can also string directly into the Len function:
<script type="text/vbscript">
document.write(Len("This is a beautiful day!"))
</script>
document.write(Len("This is a beautiful day!"))
</script>
Examples of the above output:
24
try it"
Complete VBScript Reference