Utility Function: ListIsEmpty()
- October 31, 2008 10:36 AM
- ColdFusion, Utility Function
- Comments (0)
While this is a simple bit of code to write, I personally like the syntax of checking "something is empty" over writing len(something) gt 0.
<cffunction name="ListIsEmpty" access="public" output="false" returntype="boolean">
<cfargument name="list" type="string" required="true" />
<cfargument name="delimiters" type="string" required="false" default="," />
<cfreturn (ListLen(arguments.list, arguments.delimiters) gt 0) />
</cffunction>
<cfargument name="list" type="string" required="true" />
<cfargument name="delimiters" type="string" required="false" default="," />
<cfreturn (ListLen(arguments.list, arguments.delimiters) gt 0) />
</cffunction>