How to count instances of a specified value in a List (case sensitive) in ColdFusion

ListValueCount() - count instances of a specified value in a List (case sensitive)

ListValueCount.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ListValueCount function example: how to count instances of a specified value in a List (case sensitive)</title>
</head>

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

<cfset TagList="cfindex,cfabort,cfindex,cfapplication,CFindex">
<cfoutput><b>TagList: #TagList#</b></cfoutput>

<br /><br />
<cfoutput><b>TagList[cfindex List value count]: #ListValueCount(TagList,"cfindex",",")#</b></cfoutput>
</body>
</html>






More ColdFusion examples