Len - MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference

Cfml language reference
Table of Contents

Advertisement

Chapter 2: ColdFusion Functions

Len

Returns the length of a string or a binary object.
See also ToBinary, Left, Right, and Mid.
Syntax
Len( string or binary object )
string
Any string or binary object.
Examples
<!---
<HTML>
<HEAD>
<TITLE>
Len Example
</TITLE>
</HEAD>
<BODY BGCOLOR=silver>
<H3>Len Example</H3>
<CFIF IsDefined("Form.MyText")>
<!--- if len is 0, then err --->
<CFIF Len(FORM.myText) is not 0>
<P>Your string, <CFOUTPUT>"#FORM.myText#"</CFOUTPUT>,
has <CFOUTPUT>#Len(FORM.myText)#</CFOUTPUT> characters.
<CFELSE>
<P>Please enter a string of more than 0 characters.
</CFIF>
</CFIF>
<FORM ACTION="len.cfm" METHOD="POST">
<P>Type in some text to see the length of your string.
<BR><INPUT TYPE="Text" NAME="MyText">
<BR><INPUT TYPE="Submit" NAME="Remove characters">
</FORM>
</BODY>
</HTML>
This example shows the use of Len --->
407

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion 4.5

Table of Contents