Description

Searches an array for all positions of a specified object. The function searches for simple objects such as strings and numbers or for complex objects such as structures. When the second parameter is a simple object, string searches are not case-sensitive. This function does not support searches for COM and CORBA objects.

Note that ArrayFindAllNoCase() behaves identically to ArrayFindAll(), except in the special cases where the second parameter is a function or you are searching for a string in an array of strings. When the second parameter is a function, ArrayFindAll() executes the function for each element in the array and ArrayFindAllNoCase() searches the array for the function.

Returns

Array of indices in which the object was found.

Category

Closure functions

Syntax

ArrayFindAllNoCase(array, function(arrayElement) {return true|false;})

See also

Other closure functions.

History

ColdFusion 10: Added this function.

Parameters

Parameter

Description

array

Array to search in.

object Object to search for.

function

Inline function executed for each element in the array. Returns true if the array elements match the search criterion.

arrayElement

Array element being accessed.

Example

writeDump(ArrayFindAllNoCase(["STRING","string"], "string"));
</cfscript>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy