tuple_strrstr — Backward search for strings within a string tuple.
tuple_strrstr searches within the strings of the input tuple
String for the strings of the input tuple
input tuples may only consist of strings. Otherwise
returns an error. In any case backward search is used, i.e., every string is
examined from its last to its first character. If
only one string, all strings of
ToFind are searched in it. Thus, the
output tuple consists of as many elements as
ToFind. Whenever a
searched string has been found, the position of its first occurrence gets
stored in the output tuple
Position (positions in strings are
counted starting with 0). If a string can not be found, -1 will be returned
instead of its position. If both input tuples show the same number of
elements, the strings are searched elementwise. I.e., the first string of
ToFind is searched within the first string of
second string of
ToFind is searched within the second string of
String and so on. The results of the elementwise searches are
Position that contains as many elements as
ToFind only contains one
string, this is searched within all strings of
String. Thus, in this
Position consists of as many elements as
both input tuples contain more than one element and the number of elements
differs for the input tuples,
tuple_strrstr returns an error.
If either or both of the input tuples are empty, the operator returns an empty tuple.
The position references Unicode code points. One Unicode code point may be
composed of multiple bytes in the UTF-8 string. If the position should
reference the raw bytes of the string, this operator can be switched to byte
'filename_encoding' is set to 'locale' (legacy), this
operator always uses the byte mode.
For general information about string operations see Tuple / String Operations.
HDevelop provides an in-line operation for
which can be used in an expression in the following syntax:
Position := strrstr(String, ToFind)
Input tuple with string(s) to examine.
Input tuple with string(s) to search.
Position of searched string(s) within the examined string(s).