Contact Us

Let us know to help you out quickly!

 Bharat Patel     Feb,08 2017

Clear Structure Keys in Coldfusion

Generally, If we want to clear keys value of any structure then we take it as list and use loop to clear data. That's a good way for cle aring keys value of structure inspite we do it manually. Below is the code to do it in a simple way.

<cfset str.firstname = 'ABC'><cfset str.lastname = 'XYZ'><cfset str.role = 'ADMIN'><cfdump var="#str#"><cfoutput><cfloop collection=#str# item="person"><cfset str[person] = ''></cfloop></cfoutput><cfdump var="#str#">

View Demo