tuple_str_bit_selectπ
Short descriptionπ
tuple_str_bit_select β Select single character or bit from a tuple.
Signatureπ
tuple_str_bit_select( tuple Tuple, integer Index, out tuple Selected )
Descriptionπ
tuple_str_bit_select selects a single character or bit from
a tuple Tuple of integer numbers and/or strings.
The input parameter Index determines the character or bit
position to select. Index must contain a single number. If
Index contains a floating point number, this may only
represent an integer value (without fraction). The result tuple
Selected contains a new element for each element of
Tuple. Let Index contain the number βnβ then each
element of Selected consists of the βn-thβ character
(for strings) or βn-thβ bit (for integers) of the corresponding
element of Tuple.
If Tuple is empty, an exception is raised.
Unicode code points versus bytesπ
The index reference Unicode code points. One Unicode code point may be
composed of multiple bytes in the UTF-8 string. If the index should
reference the raw bytes of the string, this operator can be switched to byte
mode with set_system('tsp_tuple_string_operator_mode','byte'). If
'filename_encoding' is set to 'locale' (legacy), this
operator always uses the byte mode.
For general information about string operations see Tuple / String Operations.
HDevelop In-line Operationπ
HDevelop provides an in-line operation for tuple_str_bit_select,
which can be used in an expression in the following syntax:
texttt{Selected := Tuple{Index}}
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π
Tuple (input_control) tuple(-array) β (string / integer)
Input tuple.
Index (input_control) integer β (integer)
Position of character or bit to select.
Selected (output_control) tuple(-array) β (string / integer)
Tuple containing the selected characters and bits.
Combinations with other operatorsπ
Combinations
Alternatives
tuple_select, tuple_first_n, tuple_last_n, tuple_concat, tuple_strchr, tuple_strrchr, tuple_str_first_n, tuple_str_last_n, tuple_substr, tuple_and, tuple_or, tuple_xor, tuple_not
See also
Moduleπ
Foundation