Format (LogiX node)
Format | ||
---|---|---|
Inputs | ||
String | Format | |
Outputs | ||
String | Str |
The Format node generates the output Str
by inserting the input parameters into specified points in the input Format
string.
Usage
The node initially spawns with one parameter input. Use the + or - buttons on the node add or remove parameter inputs.
Parameter inputs are inserted into the Format
string at positions specified by curly braces '{}'. For example, if the first parameter input Parameters.0
is a string with the value "World" and the Format
string is "Hello {0}!", the output Str
will be "Hello World!".
The output will be null if a pair of curly braces is present without a valid parameter value e.g. "{}" or "{1}" if there is only a Parameters.[0]
input.
There are many additional options which can be used to control how parameter inputs are formatted. For these more advanced options, much of the C# documentation for the Format method is applicable. For example there are many options for formatting numeric data as detailed here. For standard time & date formatting, here For custom numeric formatting, here and custom date/time formatting, here.
Examples
Tutorial from ProbablePrime which shows some basic and more advanced options: