Filter()

Top  Previous  Next

Filter() - Filter a String Array

Description

The Filter() function returns a subset of a string array based on a specified filter criteria.

Result = Filter(Array, String[, Method[, Compare]]

Return an array

Parameters
The Array parameter is the array to be filtered.

The String parameter is the case-sensistive string to filter with.

The optional Method parameter is mode to filter by. If set to True the result will contain values that matched the supplied String, if set to False the array will contain the values that did not match.

The optional Compare parameter specifies the compare mode as per [id=43]this table[/id].

Example

Dim MyArray(3)

Dim MyResult

 

MyArray(0) = "Apples"

MyArray(1) = "Oranges"

MyArray(2) = "Apricots"

 

MyResult = Filter(MyArray, "Oran") 'MyResult(0) equals Oranges