Format
Represents a parsed format string. Contains a list of FormatItem s, including LiteralText s and Placeholder s. Note: Format is IDisposable.
Read time 2 minutesLast updated 6 days ago
Definition
- Type: Class
- Namespace: Unity.SmartStrings.Core.Parsing
- Assembly: UnityEngine.SmartStringsModule
- Inherits from: FormatItem
- Implements: IDisposable
public sealed class Format : FormatItem, IDisposable
Properties
Property | Description |
|---|---|
| AdditionalData | Used to pass and return additional information during formatting. |
| HasNested | Returns |
| Items | Gets the List_1 of FormatItems. |
| ParentPlaceholder | Gets the parent Placeholder. |
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 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. |