SearchStrings (FPScript)
Searches in a data series for a string and returns the indices of the matches as a data series.
Syntax
SearchStrings(StringSeries, String, [ Operation = SEARCH_OP_IS ] [ , IgnoreCase = FALSE ])
The syntax of the SearchStrings function consists of the following parts:
Part |
Description |
||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
StringSeries |
The data series with strings to be searched in which to search for the string. Permitted data structures are data series. Supported data types are string. If the argument is a list, then the function is executed for each element of the list and the result is also a list. |
||||||||||||||||||||||||||
String |
The string for which to search. Permitted data structures are scalar value. Supported data types are string. If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. |
||||||||||||||||||||||||||
Operation |
Determines how the strings are compared. The argument Operation can have the following values:
If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. If this argument is omitted, it will be set to the default value SEARCH_OP_IS. |
||||||||||||||||||||||||||
IgnoreCase |
A Boolean value that specifies whether to ignore the case when performing a search. Permitted data structures are scalar value. Supported data types are Boolean value. If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. If this argument is omitted, it will be set to the default value FALSE. |
Remarks
As the result the function returns a data series of data type 64-bit integer.
The result is a data series with the indices of the found strings.
Available in
FlexPro Basic, Professional, Developer Suite
Examples
Dim names = {"Channel1", "Channel2", "Channel2", "Channel1", "Channel1", "Channel2"}
Dim data = { 1, -1, -2, 2, 3, -3 }
return data[SearchStrings(names, "Channel2")]
Returns all data values assigned to "Channel2" from a protocol.