The Filter function returns a zero-based array that contains a subset of a string array based on a filter criteria.
Note: If no matches of the value parameter are found, the Filter function will return an empty array.
Note: If the parameter inputstrings is Null or is NOT a one-dimensional array, an error will occur.
Parameter | Description |
---|---|
inputstrings | Required. A one-dimensional array of strings to be searched |
value | Required. The string to search for |
include | Optional. A Boolean value that indicates whether to return the substrings that include or exclude value. True returns the subset of the array that contains value as a substring. False returns the subset of the array that does not contain value as a substring. Default is True. |
compare | Optional. Specifies the string comparison to use. Can have one of the following values:
|
Filter: items that contains "S"
The output of the code above will be:
Filter: items that does NOT contain "S" (include=False):
The output of the code above will be:
Filter: items that contains "S", with a textual comparison (compare=1):
The output of the code above will be: