Skip to content

tuple_findTupleFindTupleFindtuple_findtuple_find🔗

Short description🔗

tuple_findTupleFindTupleFindtuple_findtuple_find — Return the indices of all occurrences of a tuple within another tuple.

Signature🔗

tuple_find( tuple Tuple, tuple ToFind, out integer Indices )void TupleFind( const HTuple& Tuple, const HTuple& ToFind, HTuple* Indices )static void HOperatorSet.TupleFind( HTuple tuple, HTuple toFind, out HTuple indices )def tuple_find( tuple: MaybeSequence[Union[float, int, str]], to_find: MaybeSequence[Union[float, int, str]] ) -> Sequence[int]

def tuple_find_s( tuple: MaybeSequence[Union[float, int, str]], to_find: MaybeSequence[Union[float, int, str]] ) -> intHerror tuple_find( const Hlong Tuple, const Hlong ToFind, Hlong* Indices )

Herror T_tuple_find( const Htuple Tuple, const Htuple ToFind, Htuple* Indices )

HTuple HTuple::TupleFind( const HTuple& ToFind ) const

HTuple HTuple.TupleFind( HTuple toFind )

Description🔗

tuple_findTupleFind searches Tupletupletuple sequentially for all occurrences of the values of the second tuple ToFindtoFindto_find and returns the indices in Indicesindicesindices (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 tuple Indicesindicesindices will contain the values [0,6]. If the first tuple does not contain the second tuple as a subtuple, tuple_findTupleFind returns -1 in Indicesindicesindices. 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_findTupleFind, which can be used in an expression in the following syntax:

Indices := find(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[float, int, 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[float, int, str]]Htuple (Hlong / double / char*)

Input tuple with values to find.

Indicesindicesindices (output_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Indices of the occurrences of the values to find in the tuple to examine.

Combinations with other operators🔗

Combinations

Alternatives

tuple_find_firstTupleFindFirst, tuple_find_lastTupleFindLast, tuple_sortTupleSort, tuple_inverseTupleInverse, tuple_equal_elemTupleEqualElem

Module🔗

Foundation