String formatting

Aus ExpeccoWiki

Wechseln zu: Navigation, Suche

Inhaltsverzeichnis

Schema

String formatting.png

Operation

  • Generate a formatted string for printing.

The placeHolders %1, %2,...%9 are replaced by the printed string representations of the input pins "in1", "in2", ..., "in9". These can be given Strings, Numbers and many other values. Individual "in[1-9]" pins can be left unconnected; however, the "format" input pin must be connected and have received a value for this block to trigger.

Examples

with:
    formatString = "Hello %1 this %3 is %4 %5"
and:
    in1 = "world"
    in2 = 12345 (Integer)
    in3 = 12.34 (Float)
    in4 = "xxx" (String)
    in5 = true (Boolean)
results in a generated output:
    "Hello world this 12.34 is xxx true"

Notice that %2 was not present in the format string, therefore the in2 input was not used.

Revisions

This block has been in the Standard Library since 1.7.1.



Back to Standard Library.
Previous: HexString [ Convert to ASCIIString ]
Next: String [ LeftContracted ]


Meine Werkzeuge