ListFilter

Description

Used to filter the elements in list .

Returns

A new list

Category

List functions

Syntax

listFilter(list,filter(delimiters){return true|false;});

See also

Other list functions.

History

ColdFusion (2018 release): Introduced named parameters.

ColdFusion 10: Added this function.

Parameters

Parameter

Description

list

Name of the list object.

filter

Inline function executed for each element in the list. Returns true if the list element has to be included in the resultant list.

delimiters

LIst element being accessed.

Example

<cfscript>
       myList="1,2,3,4,5,6,7,8,9";
       myFilter=ListFilter(myList,function(num){
             return num>5;
       });
       WriteOutput(myFilter); //Returns a list of all numbers greater than 5
</cfscript>

Output

6,7,8,9

 Adobe

更快、更輕鬆地獲得協助

新的使用者?

Adobe MAX 2024

Adobe MAX
創意大會

10 月 14 至 16 日邁阿密海灘和線上

Adobe MAX

創意大會

10 月 14 至 16 日邁阿密海灘和線上

Adobe MAX 2024

Adobe MAX
創意大會

10 月 14 至 16 日邁阿密海灘和線上

Adobe MAX

創意大會

10 月 14 至 16 日邁阿密海灘和線上