Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

Placeholder

class in Unity.SmartStrings.Core.Parsing

/

Inherits from:Unity.SmartStrings.Core.Parsing.FormatItem

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

A placeholder is the part of a format string between the {braces}.

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
Alignment Gets or sets the Placeholder.Alignment of the result string, used like with string.Format("{0,-10}"), where -10 is the alignment.
Format Gets or sets the Placeholder.Format of the Placeholder.
FormatterName Gets the name of the formatter.
FormatterOptions Gets the formatter option string unescaped. To get the raw formatter option string, Placeholder.FormatterOptionsRaw.
FormatterOptionsRaw Gets the raw formatter option string as in the input format string (unescaped).
NestedDepth Gets or sets the nesting level of the Placeholder.
Parent Gets the parent Format.

Public Methods

Method Description
GetSelectors Gets an Collections.Generic.IReadOnlyList_1 of all Selectors within the Placeholder.
Initialize Initializes the instance of Placeholder.
ReturnToPool Return items we own to the object pools. This method gets called by Unity.SmartStrings.Pooling.SmartPools.LiteralTextPool when it releases an instance.
ToString Gets the string representation of the Placeholder with all parsed components.

Inherited Members

Properties

PropertyDescription
BaseString Gets the base format string.
EndIndex The end index is pointing to ONE POSITION AFTER the last character of item.
Length Gets the result of FormatItem.EndIndex minus FormatItem.StartIndex.
ParentFormatItem The parent FormatItem of this instance, null if no parent exists.
RawText Retrieves the raw text that this item represents.
SmartSettings The settings for formatter and parser.
StartIndex The start index is pointing to the first character of item.

Public Methods

MethodDescription
AsSpan Gets the ReadOnlySpan_1 representation of this FormatItem.
Clear Clears the FormatItem or the derived class.

Protected Methods

MethodDescription
Initialize Initializes the FormatItem or the derived class.