Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Placeholder

A placeholder is the part of a format string between the {braces}.
Read time 2 minutesLast updated 13 days ago

Definition

public class Placeholder : FormatItem

Remarks

For example, in "{Items.Length,-10:choose(1|2|3):one|two|three}", the Placeholder.Alignments is "-10", the Selectors are "Items" and "Length", separated by the dot "Operator". the Placeholder.FormatterName is "choose", the Placeholder.FormatterOptionsRaw is "1|2|3", and the Placeholder.Format is "one|two|three".

Properties

Property

Description

AlignmentGets or sets the Placeholder.Alignment of the result string, used like with string.Format("{0,-10}"), where -10 is the alignment.
FormatGets or sets the Placeholder.Format of the Placeholder.
FormatterNameGets the name of the formatter.
FormatterOptionsGets the formatter option string unescaped. To get the raw formatter option string, Placeholder.FormatterOptionsRaw.
FormatterOptionsRawGets the raw formatter option string as in the input format string (unescaped).
NestedDepthGets or sets the nesting level of the Placeholder.
ParentGets the parent Format.

Methods

Method

Description

GetSelectorsGets an IReadOnlyList_1 of all Selectors within the Placeholder.
InitializeInitializes the instance of Placeholder.
ReturnToPoolReturn items we own to the object pools. This method gets called by LiteralTextPool when it releases an instance.
ToStringGets the string representation of the Placeholder with all parsed components.

Inheritance