docs.unity3d.com
    Show / Hide Table of Contents

    Class Format

    Represents a parsed format string. Contains a list of FormatItems, including LiteralTexts and Placeholders.

    Inheritance
    Object
    FormatItem
    Format
    Inherited Members
    FormatItem.baseString
    FormatItem.endIndex
    FormatItem.SmartSettings
    FormatItem.startIndex
    FormatItem.m_RawText
    FormatItem.Parent
    FormatItem.Init(SmartSettings, FormatItem, Int32)
    FormatItem.Init(SmartSettings, FormatItem, Int32, Int32)
    FormatItem.Init(SmartSettings, FormatItem, String, Int32, Int32)
    FormatItem.Clear()
    FormatItem.RawText
    FormatItem.ToEnumerable()
    Namespace: UnityEngine.Localization.SmartFormat.Core.Parsing
    Syntax
    public class Format : FormatItem

    Fields

    parent

    Declaration
    public Placeholder parent
    Field Value
    Type Description
    Placeholder

    Properties

    HasNested

    Declaration
    public bool HasNested { get; set; }
    Property Value
    Type Description
    Boolean

    Items

    Declaration
    public List<FormatItem> Items { get; }
    Property Value
    Type Description
    List<FormatItem>

    Methods

    GetLiteralText()

    Retrieves the literal text contained in this format. Excludes escaped chars, and does not include the text of placeholders

    Declaration
    public string GetLiteralText()
    Returns
    Type Description
    String

    IndexOf(Char)

    Searches the literal text for the search char. Does not search in nested placeholders.

    Declaration
    public int IndexOf(char search)
    Parameters
    Type Name Description
    Char search
    Returns
    Type Description
    Int32

    IndexOf(Char, Int32)

    Searches the literal text for the search char. Does not search in nested placeholders.

    Declaration
    public int IndexOf(char search, int startIndex)
    Parameters
    Type Name Description
    Char search
    Int32 startIndex
    Returns
    Type Description
    Int32

    ReleaseToPool()

    Declaration
    public void ReleaseToPool()

    Split(Char)

    Declaration
    public IList<Format> Split(char search)
    Parameters
    Type Name Description
    Char search
    Returns
    Type Description
    IList<Format>

    Split(Char, Int32)

    Declaration
    public IList<Format> Split(char search, int maxCount)
    Parameters
    Type Name Description
    Char search
    Int32 maxCount
    Returns
    Type Description
    IList<Format>

    Substring(Int32)

    Returns a substring of the current Format.

    Declaration
    public Format Substring(int startIndex)
    Parameters
    Type Name Description
    Int32 startIndex
    Returns
    Type Description
    Format

    Substring(Int32, Int32)

    Returns a substring of the current Format.

    Declaration
    public Format Substring(int startIndex, int length)
    Parameters
    Type Name Description
    Int32 startIndex
    Int32 length
    Returns
    Type Description
    Format

    ToString()

    Reconstructs the format string, but doesn't include escaped chars and tries to reconstruct placeholders.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    FormatItem.ToString()

    Extension Methods

    TupleExtensions.IsValueTuple(Object)
    TupleExtensions.GetValueTupleItemObjects(Object)
    TupleExtensions.GetValueTupleItemObjectsFlattened(Object)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023