FUNCTION:LISTLEN

last edited byusericongef on 03-Oct-2011

Contents

listLen

Description

Determines the number of elements in a list.

Usage Syntax

listLen(string list,[string delimiters,[boolean includeEmptyFields]]): number

Return Information

Return Type
number

Arguments

The arguments for this function are set. You can not use other arguments except the following ones.

Name Type Required Description
list string Yes a string list
delimiters string No Characters that separate list elements. The default value is comma.
includeEmptyFields boolean No if set to true, empty values are included as well

For all list functions Railo now supports the optional parameter includeEmptyFields. This parameter indicates whether empty fields (like in the list a,,b) are respected as well. Here’s an example: <cfset a = "1,2,3,,,4,5,6,7"> <cfdump var="#listlen(a,",",true)#"> returns 9 and <cfdump var="#listlen(a,",",false)#"> returns 7 Please note that the default for the includeEmptyFields Parameter is false.

 
Download in other Formats:
markup Markup | pdf PDF | html HTML | word Word