ProtoFlux:Substring

From Resonite Wiki
Revision as of 03:34, 23 February 2024 by Yosh (talk | contribs) (add warning about strings with chars outside bmp)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Substring
Str
*
StartIndex
Length
Strings

Substring is a ProtoFlux node that allows one to get an arbitrary portion of a provided String.

Inputs

Str (String)

The string to remove a segment from.

StartIndex (int)

The 0-indexed starting point of retrieval from Str.

Length (int)

Length of output substring.

Strings are UTF-16 encoded, and Length represents the amount of UTF16 codepoints in the output string. Usage of this node on a string containing characters outside the Basic Multilingual Plane may result in confusing behavior, such as the amount of characters in the output string being less than the Length value.

Outputs

* (String)

A segment of Str starting at StartIndex with length Length. If the segment goes past the end of Str, the output is truncated at the end of Str. If Length is less than 1, the output will be an Empty String.

Examples