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. If a data series with strings is specified, the result is a list with one list element per string. If you omit the argument, all unique strings of the input data set are searched for and the result is a list with one list element per unique string. Permitted data structures are Scalar value und Data series. 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
The result always has the data type 64-bit integer.
The result is a data series or a list of data series with the indices of the strings found.
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.