### Filter

Basic and Crystal syntax.

##### Overloads

- Filter (inputStrings, searchString)
- Filter (inputStrings, searchString, include)
- Filter (inputStrings, searchString, include, compare)

##### Arguments

- InputStrings is an array of strings to be searched.
- searchString is a string to search for.
- include is an optional Boolean value indicating whether to return substrings that include or exclude searchString. If include is True, Filter returns the subset of the array that contains searchString as a substring. If include is False, Filter returns the subset of the array that does not contain searchString as a substring. If omitted, the value True is assumed.
- compare is an optional Number value indicating the kind of string comparison to use:
  - Performs a comparison that is case-sensitive
  - Performs a comparison that is case-insensitive

    If omitted, a case-sensitive comparison is performed.

##### Returns

Array of String values.

##### Action

Filter searches an array of strings for a specified string, and returns the strings in an array.

##### Examples

The following examples are applicable to Basic and Crystal syntax.

The examples assume that inputStrings is a String array consisting of the 5 elements: "pineapple", "Apple", "APPLE", "grape", and "orange".

`Filter (inputStrings, "ap")`

Returns an array containing the 2 strings "pineapple" and "grape".

`Filter (inputStrings, "Ap", True)`

Returns an array containing the 1 string "Apple".

`Filter (inputStrings, "ap", True, 1)`

Returns an array containing the 4 strings "pineapple", "Apple", "APPLE" and "grape". Matching to the search string uses case-insensitive comparison.

`Filter (inputStrings, "ap", False)`

Returns an array containing the 3 strings "Apple", "APPLE" and "orange".

`Filter (inputStrings, "cd")`

Returns an array containing 1 string, the empty string "". The returned array does not contain any matching strings but contains 1 element since the formula language does not support empty arrays.

##### Comments

This function is designed to work like the Visual Basic function of the same name.

Seagate Software, Inc. http://www.seagatesoftware.com Please send comments to: techpubs@seagatesoftware.com