Skip to content

tuple_joinTupleJoinTupleJointuple_jointuple_join🔗

Short description🔗

tuple_joinTupleJoinTupleJointuple_jointuple_join — Join strings using separator symbol(s).

Signature🔗

tuple_join( string Strings, string Separators, out string JoinedStrings )void TupleJoin( const HTuple& Strings, const HTuple& Separators, HTuple* JoinedStrings )static void HOperatorSet.TupleJoin( HTuple strings, HTuple separators, out HTuple joinedStrings )def tuple_join( strings: MaybeSequence[str], separators: MaybeSequence[str] ) -> Sequence[str]

def tuple_join_s( strings: MaybeSequence[str], separators: MaybeSequence[str] ) -> strHerror tuple_join( const char* Strings, const char* Separators, char* JoinedStrings )

Herror T_tuple_join( const Htuple Strings, const Htuple Separators, Htuple* JoinedStrings )

HTuple HTuple::TupleJoin( const HTuple& Separators ) const

HTuple HTuple.TupleJoin( HTuple separators )

Description🔗

tuple_joinTupleJoin joins the strings of the input tuple Stringsstringsstrings interleaved with the separators defined in the input tuple Separatorsseparatorsseparators and returns the result in the tuple JoinedStringsjoinedStringsjoined_strings.

For each string element in Separatorsseparatorsseparators, there is one corresponding element in JoinedStringsjoinedStringsjoined_strings which holds the elements of Stringsstringsstrings joined by this separator. Thereby an empty string in Separatorsseparatorsseparators corresponds to simple string concatenation.

Example: Stringsstringsstrings = ['aaa', 'bbb', 'ccc', 'ddd']["aaa", "bbb", "ccc", "ddd"] and Separatorsseparatorsseparators = ['++', '–', '']["++", "–", ""]. In this case the operator returns the tuple JoinedStringsjoinedStringsjoined_strings = ['aaa++bbb++ccc++ddd', 'aaa–bbb–ccc–ddd', 'aaabbbcccddd']["aaa++bbb++ccc++ddd", "aaa–bbb–ccc–ddd", "aaabbbcccddd"].

Both input tuples (Stringsstringsstrings and Separatorsseparatorsseparators) may only consist of strings. Otherwise tuple_joinTupleJoin returns an error.

Exception: Empty input tuples🔗

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

Unicode code points versus bytes🔗

A separator always consists of the entire string. This is true regardless of the system setting of 'tsp_tuple_string_operator_mode'"tsp_tuple_string_operator_mode".

For general information about string operations see Tuple / String Operations.

HDevelop In-line Operation🔗

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

JoinedStrings := join(Strings, Separators)

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🔗

Stringsstringsstrings (input_control) string(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

Input tuple with strings to join.

Separatorsseparatorsseparators (input_control) string(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

Input tuple with separator symbol(s).

JoinedStringsjoinedStringsjoined_strings (output_control) string(-array) → (string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)

Output tuple with the contained strings.

Combinations with other operators🔗

Combinations

Possible successors

tuple_splitTupleSplit

Alternatives

tuple_strstrTupleStrstr, tuple_strrstrTupleStrrstr, tuple_strchrTupleStrchr, tuple_strrchrTupleStrrchr, tuple_strlenTupleStrlen, tuple_str_first_nTupleStrFirstN, tuple_str_last_nTupleStrLastN, tuple_environmentTupleEnvironment

Module🔗

Foundation