Initializes a new instance of the StringFormat class.

Namespace: Dapfor.Net.Formats
Assembly: Dapfor.Net (in Dapfor.Net.dll) Version: 2.10.3.24917 (2.10.3.24917)

Syntax

C#
public StringFormat(
	string formatString,
	string prefix,
	string suffix,
	IFormatProvider formatProvider
)
Visual Basic
Public Sub New ( 
	formatString As String,
	prefix As String,
	suffix As String,
	formatProvider As IFormatProvider
)
Visual C++
public:
StringFormat(
	String^ formatString, 
	String^ prefix, 
	String^ suffix, 
	IFormatProvider^ formatProvider
)
F#
new : 
        formatString : string * 
        prefix : string * 
        suffix : string * 
        formatProvider : IFormatProvider -> StringFormat

Parameters

formatString
Type: System..::..String
The string format, passed to the Format(String, array<Object>[]()[][]) method. See MSDN library for more details.
prefix
Type: System..::..String
The prefix that is added before the formatted string.
suffix
Type: System..::..String
The suffix that is added after the formatted string.
formatProvider
Type: System..::..IFormatProvider
The formatString provider.

Examples

 Copy imageCopy
public void StringFormat()
{
    IFormat format = new StringFormat("yyyy-MM-dd", "***", "!!!", CultureInfo.InvariantCulture);

    UnboundValueAccessor accessor = new UnboundValueAccessor();

    accessor["Date"].Value = new DateTime(2009, 10, 02);
    Console.WriteLine(format.Format(accessor["Date"]));
}

//Console output:
***2009-10-02!!!

See Also