length(string)

xod/core/length(string)

Calculates string size in bytes. Will be inequal to the number of glyphs if the input string is UTF-8 encoded and contains non-ASCII characters.
length(string)
@/length(string)
Calculates string size in bytes. Will be inequal to the number of glyphs if the input string is UTF-8 encoded and contains non-ASCII characters.
INstring
length(string)
OUT
IN
OUTnumber

C++ implementation

node {
    void evaluate(Context ctx) {
        auto str = getValue<input_IN>(ctx);
        emitValue<output_OUT>(ctx, length(str));
    }
}

Tabular tests

INOUT
""0
"lala"4
"I said: \"Hello, World!\""23