ClassesClassesClassesClasses | | | | Operators

tuple_strrstrtuple_strrstrTupleStrrstrtuple_strrstrTupleStrrstrTupleStrrstr (Operator)

Name

tuple_strrstrtuple_strrstrTupleStrrstrtuple_strrstrTupleStrrstrTupleStrrstr — Backward search for strings within a string tuple.

Signature

tuple_strrstr( : : String, ToFind : Position)

Herror tuple_strrstr(const char* String, const char* ToFind, Hlong* Position)

Herror T_tuple_strrstr(const Htuple String, const Htuple ToFind, Htuple* Position)

Herror tuple_strrstr(const HTuple& String, const HTuple& ToFind, Hlong* Position)

Herror tuple_strrstr(const HTuple& String, const HTuple& ToFind, HTuple* Position)

void TupleStrrstr(const HTuple& String, const HTuple& ToFind, HTuple* Position)

HTuple HTuple::TupleStrrstr(const HTuple& ToFind) const

void HOperatorSetX.TupleStrrstr(
[in] VARIANT String, [in] VARIANT ToFind, [out] VARIANT* Position)

VARIANT HTupleX.TupleStrrstr(
[in] VARIANT String, [in] VARIANT ToFind)

static void HOperatorSet.TupleStrrstr(HTuple stringVal, HTuple toFind, out HTuple position)

HTuple HTuple.TupleStrrstr(HTuple toFind)

Description

tuple_strrstrtuple_strrstrTupleStrrstrtuple_strrstrTupleStrrstrTupleStrrstr searches within the strings of the input tuple StringStringStringStringStringstringVal for the strings of the input tuple ToFindToFindToFindToFindToFindtoFind. Both input tuples may only consist of strings. Otherwise tuple_strrstrtuple_strrstrTupleStrrstrtuple_strrstrTupleStrrstrTupleStrrstr returns an error. In any case backward search is used, i.e., every string is examined from its last to its first character. If StringStringStringStringStringstringVal contains only one string, all strings of ToFindToFindToFindToFindToFindtoFind are searched in it. Thus, the output tuple consists of as many elements as ToFindToFindToFindToFindToFindtoFind. Whenever a searched string has been found, the position of its first occurrence gets stored in the output tuple PositionPositionPositionPositionPositionposition (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 ToFindToFindToFindToFindToFindtoFind is searched within the first string of StringStringStringStringStringstringVal, the second string of ToFindToFindToFindToFindToFindtoFind is searched within the second string of StringStringStringStringStringstringVal and so on. The results of the elementwise searches are returned with PositionPositionPositionPositionPositionposition that contains as many elements as StringStringStringStringStringstringVal and ToFindToFindToFindToFindToFindtoFind. If ToFindToFindToFindToFindToFindtoFind only contains one string, this is searched within all strings of StringStringStringStringStringstringVal. Thus, in this case PositionPositionPositionPositionPositionposition consists of as many elements as StringStringStringStringStringstringVal. If both input tuples contain more than one element and the number of elements differs for the input tuples, tuple_strrstrtuple_strrstrTupleStrrstrtuple_strrstrTupleStrrstrTupleStrrstr returns an error.

Exception: Empty input tuples

If either or both of the input tuples are empty, the operator returns an empty tuple.

HDevelop In-line Operation

HDevelop provides an in-line operation for tuple_strrstrtuple_strrstrTupleStrrstrtuple_strrstrTupleStrrstrTupleStrrstr, which can be used in an expression in the following syntax:

Position := strrstr(String, ToFind)

Parallelization

Parameters

StringStringStringStringStringstringVal (input_control)  string(-array) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Input tuple with string(s) to examine.

ToFindToFindToFindToFindToFindtoFind (input_control)  string(-array) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Input tuple with string(s) to search.

PositionPositionPositionPositionPositionposition (output_control)  integer(-array) HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Position of searched string(s) within the examined string(s).

Alternatives

tuple_strstrtuple_strstrTupleStrstrtuple_strstrTupleStrstrTupleStrstr, tuple_strlentuple_strlenTupleStrlentuple_strlenTupleStrlenTupleStrlen, tuple_strchrtuple_strchrTupleStrchrtuple_strchrTupleStrchrTupleStrchr, tuple_strrchrtuple_strrchrTupleStrrchrtuple_strrchrTupleStrrchrTupleStrrchr, tuple_substrtuple_substrTupleSubstrtuple_substrTupleSubstrTupleSubstr, tuple_str_first_ntuple_str_first_nTupleStrFirstNtuple_str_first_nTupleStrFirstNTupleStrFirstN, tuple_str_last_ntuple_str_last_nTupleStrLastNtuple_str_last_nTupleStrLastNTupleStrLastN, tuple_splittuple_splitTupleSplittuple_splitTupleSplitTupleSplit, tuple_environmenttuple_environmentTupleEnvironmenttuple_environmentTupleEnvironmentTupleEnvironment

Module

Foundation


ClassesClassesClassesClasses | | | | Operators