add warning about strings with chars outside bmp |
until end null input |
||
Line 14: | Line 14: | ||
|}} | |}} | ||
Substring | The '''Substring''' node allows one to get an arbitrary portion of a provided string. | ||
== Inputs == | == Inputs == | ||
Line 28: | Line 28: | ||
=== Length ([[Type:Int|int]]) === | === Length ([[Type:Int|int]]) === | ||
Length of output substring. | Length of the output substring. If no node is connected to this input, the substring will continue until the end of the string. | ||
{{Template:Note|Strings are UTF-16 encoded, and <code>Length</code> represents the amount of UTF16 codepoints in the output string. Usage of this node on a string containing characters outside the [https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane Basic Multilingual Plane] may result in confusing behavior, such as the amount of characters in the output string being less than the <code>Length</code> value.|warning}} | {{Template:Note|Strings are UTF-16 encoded, and <code>Length</code> represents the amount of UTF16 codepoints in the output string. Usage of this node on a string containing characters outside the [https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane Basic Multilingual Plane] may result in confusing behavior, such as the amount of characters in the output string being less than the <code>Length</code> value.|warning}} | ||
Line 39: | Line 39: | ||
== Examples == | == Examples == | ||
<gallery widths=480px heights=320px> | <gallery widths=480px heights=320px> | ||
File:Protoflux_example_Get_Character_Substring.webp|alt=The substring node has String input "Cheese Mobile", Start Index 4, and Length 5. The output string is "se Mo".|Substring being used to tell what's inside of a string in a provided segment, as well as its relation to [[ProtoFlux:Get_Character|Get Character]]. | File:Protoflux_example_Get_Character_Substring.webp|alt=The substring node has String input "Cheese Mobile", Start Index 4, and Length 5. The output string is "se Mo".|Substring being used to tell what's inside of a string in a provided segment, as well as its relation to [[ProtoFlux:Get_Character|Get Character]]. |
Latest revision as of 19:34, 1 January 2025
Substring
Strings
The Substring node 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 the output substring. If no node is connected to this input, the substring will continue until the end of the string.
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
-
Substring being used to tell what's inside of a string in a provided segment, as well as its relation to Get Character.