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

Format

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

Represents a parsed format string. Contains a list of FormatItems, including LiteralTexts and Placeholders.
Note: Format is IDisposable.

Properties

Property Description
AdditionalData Used to pass and return additional information during formatting.
HasNested Returns true, if the Format is nested.
Items Gets the Collections.Generic.List_1 of FormatItems.
ParentPlaceholder Gets the parent Placeholder.

Public Methods

Method Description
Dispose Returns this instance to the object pool, which also clears all objects it owns. Do not use this instance after calling Format.Dispose
GetLiteralText Retrieves the literal text contained in this format. Excludes escaped chars, and does not include the text of placeholders.
IndexOf Searches the literal text for the search char. Does not search in nested placeholders.
Initialize Initializes the Format instance.
ReturnToPool Return items we own to the object pools. This method gets called by Unity.SmartStrings.Pooling.SmartPools.FormatPool when it releases an instance.
Split Splits the Format items by the given search character.
Substring Gets a substring of the current Format.
ToString Reconstructs the format string, but doesn't include escaped chars and tries to reconstruct placeholders.

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.