Backward search for string(s) within a string tuple.
::tuple_strrstr searches within the strings of the input tuple T1 for the strings of the input tuple T2. Both input tuples may only consist of strings. Otherwise ::tuple_strrstr returns an error. In any case backward search is used, i.e., every string is examined from its last to its first character. If T1 contains only one string, all strings of T2 are searched in it. Thus the output tuple consists of as many elements as T2. Whenever a searched string has been found, the position of its first occurence 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 T2 is searched within the first string of T1, the second string of T2 is searched within the second string of T1 and so on. The results of the elementwise searches are returned with Position that contains as many elements as T1 and T2. If T2 only contains one string, this is searched within all strings of T1. Thus in this case Position consists of as many elements as T1. If both input tuples contain more than one element and the number of elements differs for the input tuples, ::tuple_strrstr returns an error.
|
T1 (input_control) |
string(-array) -> HTuple.char * |
| Input tuple 1. | |
|
T2 (input_control) |
string(-array) -> HTuple.char * |
| Input tuple 2. | |
|
Position (output_control) |
integer(-array) -> (HTuple.) long * |
| Position of searched string(s) within the examined string(s). | |
::tuple_strstr, ::tuple_strlen, ::tuple_strchr, ::tuple_strrchr, ::tuple_str_first_n, ::tuple_str_last_n, ::tuple_split, ::tuple_environment
Operators not requiring licensing