How to remove an element from a structure in ColdFusion

StructDelete() Function - Remove an element from a structure

StructDelete.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>StructDelete function example: how to remove an element from a structure</title>
</head>

<body>
<h2 style="color:HotPink">StructDelete Function Example</h2>

<cfset Color=StructNew()>
<cfset Color.ID=1>
<cfset Color.Name="LawnGreen">
<cfset Color.Value="##7CFC00">
<cfdump var="#Color#" label="Color">

<br />
<cfset Temp=StructDelete(Color,"Value")>
<cfdump var="#Color#" label="Color[after delete value key]">

</body>
</html>






More ColdFusion examples