Skip to content

tuple_find_lastTupleFindLastTupleFindLasttuple_find_lasttuple_find_last🔗

Short description🔗

tuple_find_lastTupleFindLastTupleFindLasttuple_find_lasttuple_find_last — Return the index of the last occurrence of a tuple within another tuple.

Signature🔗

tuple_find_last( tuple Tuple, tuple ToFind, out integer Index )void TupleFindLast( const HTuple& Tuple, const HTuple& ToFind, HTuple* Index )static void HOperatorSet.TupleFindLast( HTuple tuple, HTuple toFind, out HTuple index )def tuple_find_last( tuple: MaybeSequence[Union[int, float, str]], to_find: MaybeSequence[Union[int, float, str]] ) -> int

Herror tuple_find_last( const Hlong Tuple, const Hlong ToFind, Hlong* Index )

Herror T_tuple_find_last( const Htuple Tuple, const Htuple ToFind, Htuple* Index )

HTuple HTuple::TupleFindLast( const HTuple& ToFind ) const

HTuple HTuple.TupleFindLast( HTuple toFind )

Description🔗

tuple_find_lastTupleFindLast searches backward through Tupletupletuple for the first occurrence of the values of the second tuple ToFindtoFindto_find and returns the Indexindexindex (in relation to the first input tuple Tupletupletuple). For example, if Tupletupletuple contains the values [3,4,5,6,1,2,3,4,0] and ToFindtoFindto_find contains the values [3,4], the output Indexindexindex is 6. If the first tuple does not contain the second tuple as a subtuple, tuple_find_lastTupleFindLast returns -1 in Indexindexindex. It is allowed to mix strings and numbers in the input tuples.

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_find_lastTupleFindLast, which can be used in an expression in the following syntax:

Index := find_last(Tuple, ToFind)

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Tupletupletuple (input_control) tuple(-array) → (integer / real / string)HTuple (Hlong / double / HString)HTuple (int / long / double / string)MaybeSequence[Union[int, float, str]]Htuple (Hlong / double / char*)

Input tuple to examine.

ToFindtoFindto_find (input_control) tuple(-array) → (integer / real / string)HTuple (Hlong / double / HString)HTuple (int / long / double / string)MaybeSequence[Union[int, float, str]]Htuple (Hlong / double / char*)

Input tuple with values to find.

Indexindexindex (output_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Index of the last occurrence of the values to find.

Combinations with other operators🔗

Combinations

Alternatives

tuple_findTupleFind, tuple_find_firstTupleFindFirst, tuple_sortTupleSort, tuple_equal_elemTupleEqualElem

Module🔗

Foundation