Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Scripting
VBScript
 Len Function
Collapse All/Expand All Collapse All
This page is specific to
.NET Framework 3.0

Other versions are also available for the following:
Visual Basic Scripting Edition
Len Function

Returns the number of characters in a string or the number of bytes required to store a variable.

Len(string | varname)
string

Any valid string expression. If string contains Null, Null is returned.

varname

Any valid variable name. If varname contains Null, Null is returned.

The following example uses the Len function to return the number of characters in a string:

Dim MyString
MyString = Len("VBSCRIPT") ' MyString contains 8.
NoteNote:

The LenB function is used with byte data contained in a string. Instead of returning the number of characters in a string, LenB returns the number of bytes used to represent that string.

Reference

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker