String Length

Returns the number of characters in a string.

1378

Inputs/Outputs

datatype_icon

string

A string whose number of characters you want to compute.

This input also supports any data type that includes only strings, such as an array of strings or a cluster of strings.

datatype_icon

length

Number of characters in a string.

The structure of this output matches the structure of the string. For example, if you wire an array of strings to string, this output returns an array of integers. Likewise, if you wire a cluster of strings to string, this output returns a cluster of integers.

Note A character refers to a code point, a numeric unit between 0 and 10FFFF16, defined by the Unicode standard for encoding. For more information about code points, research Unicode.

Reducing Performance Burden

Characters in UTF-8 can be multiple bytes so string nodes count the number of characters in a string instead of jumping to a point in memory. Since the length and offset parameters are in units of characters, avoid nesting this node with large strings because that can create exponential functions that carry a higher performance burden.