Tutorials References Exercises Videos Menu
Create Website Get Certified Upgrade

VBScript Len Function


❮ Complete VBScript Reference

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!"
response.write(Len(txt))

%>

The output of the code above will be:

24
Show Example »

Example 2

You can also put the string directly into the Len function:

<%

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

%>

The output of the code above will be:

24
Show Example »

❮ Complete VBScript Reference