ae1e028b 269c db33 11ee 55ae634dde66 - akesseler/Plexdata.Utilities.Templates GitHub Wiki
This class represents the Plexdata Template Formatter.
System.Object
Plexdata.Utilities.Formatting.Template
Namespace: Plexdata.Utilities.Formatting
Assembly: Plexdata.Utilities.Templates (in Plexdata.Utilities.Templates.dll) Version: 1.0.0
C#
public static class Template
Name | Description | |
---|---|---|
![]() ![]() |
Format(String, Object[]) | Formats the list of arguments into the format string. |
![]() ![]() |
Format(IFormatProvider, String, Object[]) | Formats the list of arguments into the format string using given format provider. |
![]() ![]() |
Format(IArgumentRelations, String, Object[]) | Formats the list of arguments into the format string. |
![]() ![]() |
Format(IArgumentSerializer, String, Object[]) | Formats the list of arguments into the format string using given argument serializer. |
![]() ![]() |
Format(Options, String, Object[]) | Formats the list of arguments into the format string using given options. |
![]() ![]() |
Format(IFormatProvider, IArgumentRelations, String, Object[]) | Formats the list of arguments into the format string using given format provider. |
![]() ![]() |
Format(IFormatProvider, IArgumentSerializer, String, Object[]) | Formats the list of arguments into the format string using given format provider as well as given argument serializer. |
![]() ![]() |
Format(IArgumentSerializer, IArgumentRelations, String, Object[]) | Formats the list of arguments into the format string using given argument serializer. |
![]() ![]() |
Format(Options, IArgumentRelations, String, Object[]) | Formats the list of arguments into the format string using given options. |
![]() ![]() |
Format(Boolean, Options, IArgumentRelations, String, Object[]) | Formats the list of arguments into the format string using given options. |
![]() ![]() |
Format(IFormatProvider, IArgumentSerializer, IArgumentRelations, String, Object[]) | Formats the list of arguments into the format string using given format provider as well as given argument serializer. |
![]() ![]() |
Truncate | Cuts off the builder, if necessary. |
The Plexdata Template Formatter can be used like the equivalent Format
methods of class String
but with full template support.
More information about template formatting can be found on the Internet under https://messagetemplates.org.
Here are some examples to illustrate a usage.
C#
// Both examples would produce an output like:
// "Date: 10/29/20, Buyer: John Doe, Sales: $1,234.57"
Template.Format(
"Date: {0:MM/dd/yy}, Buyer: {1}, Sales: {2:C}",
date, name, sales);
Template.Format(
"Date: {date:MM/dd/yy}, Buyer: {buyer}, Sales: {sales:C}",
date, name, sales);