Skip to content

Instantly share code, notes, and snippets.

@davejlong
Created May 20, 2011 19:53
Show Gist options
  • Save davejlong/983654 to your computer and use it in GitHub Desktop.
Save davejlong/983654 to your computer and use it in GitHub Desktop.
Array Find for Pre CF9 Servers
<cfcomponent>
<cfif left(Server.ColdFusion.productversion,1) LT 9>
<cffunction name="arrayFind" access="public" output="false" returntype="Numeric" hint="Returns the index of the first found element in the array containing the value argument">
<cfargument name="array" required="true" type="array" />
<cfargument name="value" required="true" type="string" />
<cfreturn (Arguments.array.indexOf(Arguments.value)) +1 />
</cffunction>
</cfif>
</cfcomponent>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment