ae1e028b 269c db33 11ee 55ae634dde66 - akesseler/Plexdata.Utilities.Templates GitHub Wiki

Template Class

This class represents the Plexdata Template Formatter.

Inheritance Hierarchy

System.Object
  Plexdata.Utilities.Formatting.Template
Namespace: Plexdata.Utilities.Formatting
Assembly: Plexdata.Utilities.Templates (in Plexdata.Utilities.Templates.dll) Version: 1.0.0

Syntax

C#

public static class Template

Methods

 

Name Description
Public methodStatic member Format(String, Object[]) Formats the list of arguments into the format string.
Public methodStatic member Format(IFormatProvider, String, Object[]) Formats the list of arguments into the format string using given format provider.
Public methodStatic member Format(IArgumentRelations, String, Object[]) Formats the list of arguments into the format string.
Public methodStatic member Format(IArgumentSerializer, String, Object[]) Formats the list of arguments into the format string using given argument serializer.
Public methodStatic member Format(Options, String, Object[]) Formats the list of arguments into the format string using given options.
Public methodStatic member Format(IFormatProvider, IArgumentRelations, String, Object[]) Formats the list of arguments into the format string using given format provider.
Public methodStatic member Format(IFormatProvider, IArgumentSerializer, String, Object[]) Formats the list of arguments into the format string using given format provider as well as given argument serializer.
Public methodStatic member Format(IArgumentSerializer, IArgumentRelations, String, Object[]) Formats the list of arguments into the format string using given argument serializer.
Public methodStatic member Format(Options, IArgumentRelations, String, Object[]) Formats the list of arguments into the format string using given options.
Private methodStatic member Format(Boolean, Options, IArgumentRelations, String, Object[]) Formats the list of arguments into the format string using given options.
Public methodStatic member 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.
Private methodStatic member Truncate Cuts off the builder, if necessary.
  Back to Top

Remarks

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.

Examples

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);

See Also

Reference

Plexdata.Utilities.Formatting Namespace

⚠️ **GitHub.com Fallback** ⚠️