Please note, this is a STATIC archive of website www.w3schools.com from 05 May 2020, cach3.com does not collect or store any user information, there is no "phishing" involved.
THE WORLD'S LARGEST WEB DEVELOPER SITE

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