W3Schools.com

VBScript Len Function


VBScript Reference 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

<script type="text/vbscript">

txt="This is a beautiful day!"
document.write(Len(txt))

</script>

The output of the code above will be:

24

Try it yourself »

Example 2

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

<script type="text/vbscript">

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

</script>

The output of the code above will be:

24

Try it yourself »

VBScript Reference Complete VBScript Reference
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE