Joutsen  v0.4.1
Public Member Functions | List of all members
Joutsen.System.StringFormatter Class Reference

A class that can format Strings with nummeric or named placeholders/identifiers. More...

Public Member Functions

string Format (string format, params object[] values)
 Formats a String with numeric placeholders. More...
 
string Format (string format, Map< String, Object > values)
 Formats a String with named placeholders. More...
 
string Format (string format, object values)
 Formats a String with named placeholders. More...
 

Detailed Description

A class that can format Strings with nummeric or named placeholders/identifiers.

Version
0.0.1

Member Function Documentation

◆ Format() [1/3]

string Joutsen.System.StringFormatter.Format ( string  format,
params object []  values 
)

Formats a String with numeric placeholders.

Parameters
formatThe format String
valuesThe objects that are filled into the format string according to their index in the array
Returns
The formatted String
Remarks
This is a shorthand extension method for System.String.Format.

◆ Format() [2/3]

string Joutsen.System.StringFormatter.Format ( string  format,
Map< String, Object >  values 
)

Formats a String with named placeholders.

Parameters
formatThe format String containing named placeholders
valuesPairs of name and value where each name is a placeholder that will be replaced with the corresponding value returns The formatted String
Remarks
The format String can contain placeholders in the form of "{&lt;name&gt;}" which will be replaced by the value in the values dictionary that is associated with the key <name>. All additional formats that are supported by System.String.Format are supported.

◆ Format() [3/3]

string Joutsen.System.StringFormatter.Format ( string  format,
object  values 
)

Formats a String with named placeholders.

Parameters
formatThe format String containing named placeholders
valuesAn System.Object where each property name used as a placeholder in the format String will be replaced with the properties value
Returns
The formatted String
Remarks
The format String can contain placeholders in the form of "{&lt;name&gt;}" which will be replaced by the value of the values object's property <name>. All additional formats that are supported by {System.String.Format are supported.