Class SmartExtensions
Extensions to support smart format common use cases.
Namespace: UnityEngine.Localization.SmartFormat
Syntax
public static class SmartExtensions
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 |