Skip to content

tuple_str_bit_selectTupleStrBitSelectTupleStrBitSelecttuple_str_bit_selecttuple_str_bit_selectπŸ”—

Short descriptionπŸ”—

tuple_str_bit_selectTupleStrBitSelectTupleStrBitSelecttuple_str_bit_selecttuple_str_bit_select β€” Select single character or bit from a tuple.

SignatureπŸ”—

tuple_str_bit_select( tuple Tuple, integer Index, out tuple Selected )void TupleStrBitSelect( const HTuple& Tuple, const HTuple& Index, HTuple* Selected )static void HOperatorSet.TupleStrBitSelect( HTuple tuple, HTuple index, out HTuple selected )def tuple_str_bit_select( tuple: MaybeSequence[Union[str, int]], index: int ) -> Sequence[Union[str, int]]

def tuple_str_bit_select_s( tuple: MaybeSequence[Union[str, int]], index: int ) -> Union[str, int]Herror tuple_str_bit_select( const char* Tuple, const Hlong Index, char* Selected )

Herror T_tuple_str_bit_select( const Htuple Tuple, const Htuple Index, Htuple* Selected )

HTuple HTuple::TupleStrBitSelect( const HTuple& Index ) const

HTuple HTuple.TupleStrBitSelect( HTuple index )

DescriptionπŸ”—

tuple_str_bit_selectTupleStrBitSelect selects a single character or bit from a tuple Tupletupletuple of integer numbers and/or strings. The input parameter Indexindexindex determines the character or bit position to select. Indexindexindex must contain a single number. If Indexindexindex contains a floating point number, this may only represent an integer value (without fraction). The result tuple Selectedselectedselected contains a new element for each element of Tupletupletuple. Let Indexindexindex contain the number β€œn” then each element of Selectedselectedselected consists of the β€œn-th” character (for strings) or β€œn-th” bit (for integers) of the corresponding element of Tupletupletuple.

If Tupletupletuple 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'"filename_encoding" is set to 'locale'"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_selectTupleStrBitSelect, 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πŸ”—

Tupletupletuple (input_control) tuple(-array) β†’ (string / integer)HTuple (HString / Hlong)HTuple (string / int / long)MaybeSequence[Union[str, int]]Htuple (char* / Hlong)

Input tuple.

Indexindexindex (input_control) integer β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Position of character or bit to select.

Selectedselectedselected (output_control) tuple(-array) β†’ (string / integer)HTuple (HString / Hlong)HTuple (string / int / long)Sequence[Union[str, int]]Htuple (char* / Hlong)

Tuple containing the selected characters and bits.

Combinations with other operatorsπŸ”—

Combinations

Alternatives

tuple_selectTupleSelect, tuple_first_nTupleFirstN, tuple_last_nTupleLastN, tuple_concatTupleConcat, tuple_strchrTupleStrchr, tuple_strrchrTupleStrrchr, tuple_str_first_nTupleStrFirstN, tuple_str_last_nTupleStrLastN, tuple_substrTupleSubstr, tuple_andTupleAnd, tuple_orTupleOr, tuple_xorTupleXor, tuple_notTupleNot

See also

tuple_removeTupleRemove

ModuleπŸ”—

Foundation