Len Function

Tips >>ASP Functions

WANTS TO MAKE SOFTWARE WITHOUT KNOWLEDGE OF ASP? CLICK HERE

The Len function returns the number of characters in a string. Len is a commonly used ASP function that allows you to determine the number of characters in a string. In other languages, a similar function would be "length". Len takes in just one parameter: Gives the number of characters in a string or the number of bytes required to store a variable. Returns the number of characters in a string or the number of bytes required to store a variable. Returns the number of characters in a string or the number of bytes required to store a variable.


The Syntax of the Len function is :-

Len(string|varname)

Example#1 :-

Code :-
dim txt
txt="This is a beautiful day!"
document.write(Len(txt))
Output :-
24

Example#2 :-

Code :-
<%
Dim strNamestrName = "Paco's Drivers"
Response.Write Len(strName)
%>
Output :-

14

Example#3 :-

Code :-
<%
=Len("Clouded leopards are an endangeredspecies.")
%>
Output :-
43

Example#4 :-

Code :-
<%
anystring ="Clouded leopards are anendangered species."
%>
<% =Len(anystring) %>
Output :-
43


Example#5 :-

Code :-
<%
anyvariable = 123.456
%>
<% =Len(anyvariable) %>
Output :-
7

 

Note :- 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.

 

 
E-mail : sales@virtualsplat.com
Phone : +91-9892413501

+91-9967648641

+91-9967648641