ColdFusion - How to get total number of elements in a List

ListLen() - get total number of elements in a List

ListLen.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ListLen function example: how to get total number of elements in a List</title>
</head>

<body>
<h2 style="color:hotpink">ListLen Function Example</h2>

<cfset TagList="cfquery,cfset,cfexit,cfindex">
<cfoutput><b>TagList: #TagList#</b></cfoutput>

<br /><br />
<cfoutput><b>TagList[Total List Element]: #ListLen(TagList,",")#</b></cfoutput>
</body>
</html>





More ColdFusion examples