ASP Vbscript Len Function

Updated on 21 Feb 2012,
Published on 02 Aug 2008

In ASP web pages, Vbscript Len function is used to get the length of a string. Vbscript Len string function returns the number of characters in the specified string. You can use the Len function to get the character count or string length that can be used in other vbscript string functions. You can also use the vbscript Len function with InStr, InStrRev, Mid or Replace string function to perform the string manipulation from the right end of the provided string.

Classic ASP VbScript String Functions Examples:

You can see the live samples and examples of Classic ASP VbScript String functions from the following links:

Syntax for ASP Vbscript Len Function

Len(string)

Vbscript Len function of vbscript accepts 1 string type parameter that can be passed be using vbscript variable of string type or string value directly.

Examples of ASP Vbscript Len Function

Example 1
<%

Dim myString

myString = "Vbscript Len Function"

Response.Write(Len(myString))

%>
Example 2
<%
 
Response.Write(Len("get the length of this string"))

%>

Output:

You can see the output of above discussed code from the following link:

String Len Function

Continue to next tutorial: ASP Vbscript Left String Function to learn how to get substring starting from left side of specified string.

0 Responses to "ASP Vbscript Len Function"
Leave a Comment
* required
* required
* will not be published
* optional
* hint: http://www.example.com
  • Subscribe via Email