tuple_strlentuple_strlenTupleStrlenTupleStrlen (Operator)

Name

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

Signature

tuple_strlen( : : T1 : Length)

Herror tuple_strlen(const char* T1, Hlong* Length)

Herror T_tuple_strlen(const Htuple T1, Htuple* Length)

void TupleStrlen(const HTuple& T1, HTuple* Length)

HTuple HTuple::TupleStrlen() const

static void HOperatorSet.TupleStrlen(HTuple t1, out HTuple length)

HTuple HTuple.TupleStrlen()

Description

tuple_strlentuple_strlenTupleStrlenTupleStrlenTupleStrlen checks the length of every string within the input tuple T1T1T1T1t1 and returns the length of each string with the output tuple LengthLengthLengthLengthlength. All elements of T1T1T1T1t1 may only consist of strings. Otherwise tuple_strlentuple_strlenTupleStrlenTupleStrlenTupleStrlen 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')set_system("tsp_tuple_string_operator_mode", "byte")SetSystem("tsp_tuple_string_operator_mode", "byte")SetSystem("tsp_tuple_string_operator_mode", "byte")SetSystem("tsp_tuple_string_operator_mode", "byte"). If 'filename_encoding'"filename_encoding""filename_encoding""filename_encoding""filename_encoding" is set to 'locale'"locale""locale""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_strlentuple_strlenTupleStrlenTupleStrlenTupleStrlen, which can be used in an expression in the following syntax:

Length := strlen(T1)

Execution Information

Parameters

T1T1T1T1t1 (input_control)  string(-array) HTupleHTupleHtuple (string) (string) (HString) (char*)

Input tuple.

LengthLengthLengthLengthlength (output_control)  integer(-array) HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Lengths of the single strings of the input tuple.

Alternatives

tuple_strstrtuple_strstrTupleStrstrTupleStrstrTupleStrstr, tuple_strrstrtuple_strrstrTupleStrrstrTupleStrrstrTupleStrrstr, tuple_strchrtuple_strchrTupleStrchrTupleStrchrTupleStrchr, tuple_strrchrtuple_strrchrTupleStrrchrTupleStrrchrTupleStrrchr, tuple_substrtuple_substrTupleSubstrTupleSubstrTupleSubstr, tuple_str_first_ntuple_str_first_nTupleStrFirstNTupleStrFirstNTupleStrFirstN, tuple_str_last_ntuple_str_last_nTupleStrLastNTupleStrLastNTupleStrLastN, tuple_splittuple_splitTupleSplitTupleSplitTupleSplit, tuple_environmenttuple_environmentTupleEnvironmentTupleEnvironmentTupleEnvironment

See also

tuple_is_stringtuple_is_stringTupleIsStringTupleIsStringTupleIsString

Module

Foundation