How to get List element at a specified position in ColdFusion

ListGetAt() - get List element at a specified position

ListGetAt.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ListGetAt function example: how to get List element at a specified position</title>
</head>

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

<cfset ColorList="FloralWhite,ForestGreen,Fuchsia,Gainsboro">
<cfoutput><b>ColorList: #ColorList#</b></cfoutput>

<br /><br />
<cfoutput><b>ColorList Element At Position 3: #ListGetAt(ColorList,3,",")#</b></cfoutput>
</body>
</html>





More ColdFusion examples