Skip to content

tuple_strlenTupleStrlenTupleStrlentuple_strlentuple_strlen🔗

Short description🔗

tuple_strlenTupleStrlenTupleStrlentuple_strlentuple_strlen — Determine the length of every string within a tuple of strings.

Signature🔗

tuple_strlen( string T1, out integer Length )void TupleStrlen( const HTuple& T1, HTuple* Length )static void HOperatorSet.TupleStrlen( HTuple t1, out HTuple length )def tuple_strlen( t1: MaybeSequence[str] ) -> Sequence[int]

def tuple_strlen_s( t1: MaybeSequence[str] ) -> intHerror tuple_strlen( const char* T1, Hlong* Length )

Herror T_tuple_strlen( const Htuple T1, Htuple* Length )

HTuple HTuple::TupleStrlen( ) const

HTuple HTuple.TupleStrlen( )

Description🔗

tuple_strlenTupleStrlen checks the length of every string within the input tuple T1t1t1 and returns the length of each string with the output tuple Lengthlengthlength. All elements of T1t1t1 may only consist of strings. Otherwise tuple_strlenTupleStrlen returns an error.

If the input tuple is empty, the operator returns an empty tuple.

Unicode code points versus bytes🔗

The string length references Unicode code points. One Unicode code point may be composed of multiple bytes in the UTF-8 string. If the length 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_strlenTupleStrlen, which can be used in an expression in the following syntax:

Length := strlen(T1)

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🔗

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

Input tuple.

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

Lengths of the single strings of the input tuple.

Combinations with other operators🔗

Combinations

Alternatives

tuple_strstrTupleStrstr, tuple_strrstrTupleStrrstr, tuple_strchrTupleStrchr, tuple_strrchrTupleStrrchr, tuple_substrTupleSubstr, tuple_str_first_nTupleStrFirstN, tuple_str_last_nTupleStrLastN, tuple_splitTupleSplit, tuple_environmentTupleEnvironment

See also

tuple_is_stringTupleIsString

Module🔗

Foundation