Len VBScript function

Syntax: Len(String)
The function will simply return the length of the string.

Example 1:

<%
String1="michael"
Response.write Len(String1)
%>

Result displayed on the screen would be:
7

* Remember that for the length function the first character has a starting index of 1.

Example 2:

<%
String1="michael"
Response.write Left(String1,Len(String1)-4)
'the above code i.e. Len(String1) returns the length of the string michael i.e. 7
'Next it takes 4 way leaving us with 3 characters
'We then use the Left function to return the first 3 characters from the left

%>

Result displayed on the screen would be:
mic



Other useful VBScript functions for Parsing String

Get the best asp web hosting provider now and save 30%

Advertisements



MembersPro

MembersPro PayPal - ASP Membership software

Plug and play ASP membership script that integrates with PayPal to let you charge recurring membership fees.