arrayFindAllNoCase

Searches an array for all positions of a specified value. The function searches for simple values such as strings and numbers or for complex objects such as structures. When the second parameter is a simple value, string searches are case-sensitive

arrayFindAllNoCase(array, value) → returns array

Member Function Syntax

someArray.findAllNoCase(value or callback)

Argument Reference

array array
Required

The source array to search through

value variableName
Required

If string, case insensitive value to search for; if callback, use signature function (item, index, array) : boolean

Examples
Sample code invoking the arrayFindAllNoCase function

Find the positions of a given string within a provided array regardless of case.

var fruitArray = ['apple','banana','apple','orange','kiwi'];
var applePositions = arrayFindAllNoCase(fruitArray, 'APPLE');
writeDump(applePositions);

Expected Result: [1,3].

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub