tuple_strlentuple_strlenTupleStrlenTupleStrlentuple_strlen (算子)
名称
tuple_strlentuple_strlenTupleStrlenTupleStrlentuple_strlen — 确定字符串元组中每个字符串的长度。
签名
Herror tuple_strlen(const char* T1, Hlong* Length)
Herror T_tuple_strlen(const Htuple T1, Htuple* Length)
def tuple_strlen(t1: MaybeSequence[str]) -> Sequence[int]
def tuple_strlen_s(t1: MaybeSequence[str]) -> int
描述
tuple_strlentuple_strlenTupleStrlenTupleStrlenTupleStrlentuple_strlen checks the length of every string within the
input tuple T1T1T1T1t1t1 and returns the length of each string with
the output tuple LengthLengthLengthLengthlengthlength. All elements of T1T1T1T1t1t1
may only consist of strings. Otherwise tuple_strlentuple_strlenTupleStrlenTupleStrlenTupleStrlentuple_strlen returns an
error.
If the input tuple is empty, the operator returns an empty tuple.
Unicode 码点与字节
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")set_system("tsp_tuple_string_operator_mode","byte")。If
'filename_encoding'"filename_encoding""filename_encoding""filename_encoding""filename_encoding""filename_encoding" is set to 'locale'"locale""locale""locale""locale""locale" (legacy), this
operator always uses the byte mode.
For general information about string operations see
Tuple / String Operations。
HDevelop 内联操作
HDevelop provides an in-line operation for tuple_strlentuple_strlenTupleStrlenTupleStrlenTupleStrlentuple_strlen,
which can be used in an expression in the following syntax:
Length := strlen(T1)
执行信息
- 多线程类型:独立(即使使用独占算子也能并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
T1T1T1T1t1t1 (输入控制) string(-array) → HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Input tuple.
LengthLengthLengthLengthlengthlength (输出控制) integer(-array) → HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Lengths of the single strings of the input tuple.
替代
tuple_strstrtuple_strstrTupleStrstrTupleStrstrTupleStrstrtuple_strstr,
tuple_strrstrtuple_strrstrTupleStrrstrTupleStrrstrTupleStrrstrtuple_strrstr,
tuple_strchrtuple_strchrTupleStrchrTupleStrchrTupleStrchrtuple_strchr,
tuple_strrchrtuple_strrchrTupleStrrchrTupleStrrchrTupleStrrchrtuple_strrchr,
tuple_substrtuple_substrTupleSubstrTupleSubstrTupleSubstrtuple_substr,
tuple_str_first_ntuple_str_first_nTupleStrFirstNTupleStrFirstNTupleStrFirstNtuple_str_first_n,
tuple_str_last_ntuple_str_last_nTupleStrLastNTupleStrLastNTupleStrLastNtuple_str_last_n,
tuple_splittuple_splitTupleSplitTupleSplitTupleSplittuple_split,
tuple_environmenttuple_environmentTupleEnvironmentTupleEnvironmentTupleEnvironmenttuple_environment
另见
tuple_is_stringtuple_is_stringTupleIsStringTupleIsStringTupleIsStringtuple_is_string
模块
基础