docs.unity3d.com
    Show / Hide Table of Contents

    Class SmartExtensions

    Extensions to support smart format common use cases.

    Inheritance
    Object
    SmartExtensions
    Namespace: UnityEngine.Localization.SmartFormat
    Syntax
    public static class SmartExtensions : object

    Methods

    AppendLineSmart(StringBuilder, String, Object[])

    AppendLines a formatted string, using the same semantics as Smart.Format.

    Declaration
    public static void AppendLineSmart(this StringBuilder sb, string format, params object[] args)
    Parameters
    Type Name Description
    StringBuilder sb

    The StringBuilder that will be used for output

    String format

    The template that defines how the arguments are formatted

    Object[] args

    A list of arguments to be used in formatting

    AppendSmart(StringBuilder, String, Object[])

    Appends a formatted string, using the same semantics as Smart.Format.

    Declaration
    public static void AppendSmart(this StringBuilder sb, string format, params object[] args)
    Parameters
    Type Name Description
    StringBuilder sb

    The StringBuilder that will be used for output

    String format

    The template that defines how the arguments are formatted

    Object[] args

    A list of arguments to be used in formatting

    FormatSmart(String, Object[])

    Formats the specified arguments using this string as a template.

    Declaration
    public static string FormatSmart(this string format, params object[] args)
    Parameters
    Type Name Description
    String format

    The template that defines how the arguments are formatted

    Object[] args

    A list of arguments to be used in formatting

    Returns
    Type Description
    String

    FormatSmart(String, ref FormatCache, Object[])

    Formats the specified arguments using this string as a template. Caches the parsing results for increased performance.

    Declaration
    public static string FormatSmart(this string format, ref FormatCache cache, params object[] args)
    Parameters
    Type Name Description
    String format

    The template that defines how the arguments are formatted

    UnityEngine.Localization.SmartFormat.Core.Formatting.FormatCache cache

    Outputs an object that increases performance if the same format string is used repeatedly.

    Object[] args

    A list of arguments to be used in formatting

    Returns
    Type Description
    String

    WriteLineSmart(TextWriter, String, Object[])

    Writes out a formatted string, using the same semantics as Smart.Format.

    Declaration
    public static void WriteLineSmart(this TextWriter writer, string format, params object[] args)
    Parameters
    Type Name Description
    TextWriter writer

    The TextWriter that will be used for output

    String format

    The template that defines how the arguments are formatted

    Object[] args

    A list of arguments to be used in formatting

    WriteSmart(TextWriter, String, Object[])

    Writes out a formatted string, using the same semantics as Smart.Format.

    Declaration
    public static void WriteSmart(this TextWriter writer, string format, params object[] args)
    Parameters
    Type Name Description
    TextWriter writer

    The TextWriter that will be used for output

    String format

    The template that defines how the arguments are formatted

    Object[] args

    A list of arguments to be used in formatting

    Back to top
    Terms of use
    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