tuple_jointuple_joinTupleJoinTupleJointuple_join (Operator)
Name
tuple_jointuple_joinTupleJoinTupleJointuple_join — Join strings using separator symbol(s).
Signature
def tuple_join(strings: MaybeSequence[str], separators: MaybeSequence[str]) -> Sequence[str]
def tuple_join_s(strings: MaybeSequence[str], separators: MaybeSequence[str]) -> str
Description
tuple_jointuple_joinTupleJoinTupleJoinTupleJointuple_join joins the strings of the input tuple
StringsStringsStringsStringsstringsstrings interleaved with the separators defined in the input tuple
SeparatorsSeparatorsSeparatorsSeparatorsseparatorsseparators and returns the result in the tuple
JoinedStringsJoinedStringsJoinedStringsJoinedStringsjoinedStringsjoined_strings.
For each string element in SeparatorsSeparatorsSeparatorsSeparatorsseparatorsseparators, there is one corresponding
element in JoinedStringsJoinedStringsJoinedStringsJoinedStringsjoinedStringsjoined_strings which holds the elements of StringsStringsStringsStringsstringsstrings
joined by this separator.
Thereby an empty string in SeparatorsSeparatorsSeparatorsSeparatorsseparatorsseparators corresponds to simple
string concatenation.
Example: StringsStringsStringsStringsstringsstrings = ['aaa', 'bbb', 'ccc', 'ddd']["aaa", "bbb", "ccc", "ddd"]["aaa", "bbb", "ccc", "ddd"]["aaa", "bbb", "ccc", "ddd"]["aaa", "bbb", "ccc", "ddd"]["aaa", "bbb", "ccc", "ddd"]
and SeparatorsSeparatorsSeparatorsSeparatorsseparatorsseparators = ['++', '--', '']["++", "--", ""]["++", "--", ""]["++", "--", ""]["++", "--", ""]["++", "--", ""].
In this case the operator returns the tuple JoinedStringsJoinedStringsJoinedStringsJoinedStringsjoinedStringsjoined_strings =
['aaa++bbb++ccc++ddd', 'aaa--bbb--ccc--ddd', 'aaabbbcccddd']["aaa++bbb++ccc++ddd", "aaa--bbb--ccc--ddd", "aaabbbcccddd"]["aaa++bbb++ccc++ddd", "aaa--bbb--ccc--ddd", "aaabbbcccddd"]["aaa++bbb++ccc++ddd", "aaa--bbb--ccc--ddd", "aaabbbcccddd"]["aaa++bbb++ccc++ddd", "aaa--bbb--ccc--ddd", "aaabbbcccddd"]["aaa++bbb++ccc++ddd", "aaa--bbb--ccc--ddd", "aaabbbcccddd"].
Both input tuples (StringsStringsStringsStringsstringsstrings and SeparatorsSeparatorsSeparatorsSeparatorsseparatorsseparators)
may only consist of strings.
Otherwise tuple_jointuple_joinTupleJoinTupleJoinTupleJointuple_join 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""tsp_tuple_string_operator_mode""tsp_tuple_string_operator_mode""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_jointuple_joinTupleJoinTupleJoinTupleJointuple_join, which can be
used in an expression in the following syntax:
JoinedStrings := join(Strings, Separators)
Execution Information
- Multithreading type: independent (runs in parallel even with exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
StringsStringsStringsStringsstringsstrings (input_control) string(-array) → HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Input tuple with strings to join.
SeparatorsSeparatorsSeparatorsSeparatorsseparatorsseparators (input_control) string(-array) → HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Input tuple with separator symbol(s).
JoinedStringsJoinedStringsJoinedStringsJoinedStringsjoinedStringsjoined_strings (output_control) string(-array) → HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Output tuple with the contained strings.
Possible Successors
tuple_splittuple_splitTupleSplitTupleSplitTupleSplittuple_split
Alternatives
tuple_strstrtuple_strstrTupleStrstrTupleStrstrTupleStrstrtuple_strstr,
tuple_strrstrtuple_strrstrTupleStrrstrTupleStrrstrTupleStrrstrtuple_strrstr,
tuple_strchrtuple_strchrTupleStrchrTupleStrchrTupleStrchrtuple_strchr,
tuple_strrchrtuple_strrchrTupleStrrchrTupleStrrchrTupleStrrchrtuple_strrchr,
tuple_strlentuple_strlenTupleStrlenTupleStrlenTupleStrlentuple_strlen,
tuple_str_first_ntuple_str_first_nTupleStrFirstNTupleStrFirstNTupleStrFirstNtuple_str_first_n,
tuple_str_last_ntuple_str_last_nTupleStrLastNTupleStrLastNTupleStrLastNtuple_str_last_n,
tuple_environmenttuple_environmentTupleEnvironmentTupleEnvironmentTupleEnvironmenttuple_environment
Module
Foundation