FilterValues()
Category: Text
Syntax: FilterValues ( textToFilter; filterValues ) |
Parameters:
textToFilterA return-delimited text string or expression that generates a return-delimited text string.
filterValuesA return-delimited text string or expression that generates a return-delimited text string representing values that you want to preserve in the specified text.
Data type returned: Text
Description:
FilterValues() produces a return-delimited list of items in textToFilter that are included among the specified filterValues. The items must match exactly in order to be returned, with the exception of case; FilterValues() is not case sensitive.
Values are returned in the order they appear in textToFilter. If filterValues is an empty string, or if no items in textToFilter are contained in the filterValues list, then an empty string is returned.
FilterValues() can be used to determine whether a particular item is part of a return-delimited array. For instance, the WindowNames() function produces a return-delimited list of windows. If you wanted to know whether a window named Contact Detail existed, you could use the following formula:
ValueCount ( FilterValues ( WindowNames; "Contact Detail" ))
If the value count is anything other than zero, that means the window name was found. The benefit of using FilterValues for this rather than PatternCount() is that Contact Detail - 2 would not be returned if Contact Detail were the filter.
Examples:
Function |
Results |
---|---|
FilterValues(Offices; "San Francisco¶Chicago¶Philadelphia" ) |
Returns Chicago¶Philadelphia when Offices contains: Chicago¶Philadelphia¶San Mateo. |