Func Len
# VBScript Len Function
* * Complete VBScript Reference Manual](#)
* * *
The Len function returns the number of characters in a string.
### Syntax
Len(string)
| Parameter | Description |
| :--- | :--- |
| string | A string expression. |
## Examples
## Example 1
txt="This is a beautiful day!"
document.write(Len(txt))
The above example outputs:
24
[Try it out Β»](#)
## Example 2
You can also put the string directly into the Len function:
document.write(Len("This is a beautiful day!"))
The above example outputs:
24
[Try it out Β»](#)
* * Complete VBScript Reference Manual](#)
YouTip