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
)
Visual Basic
Public Sub New ( 
	formatString As String,
	prefix As String,
	suffix As String
)
Visual C++
public:
StringFormat(
	String^ formatString, 
	String^ prefix, 
	String^ suffix
)
F#
new : 
        formatString : string * 
        prefix : string * 
        suffix : string -> 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.

Examples

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

    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