Formats an object to a string for display.

Namespace:  Gallio.Runtime.Formatting
Assembly:  Gallio (in Gallio.dll) Version: 3.3.0.0 (3.3.610.0)

Syntax

C#
string Format(
	Object obj
)
Visual Basic (Declaration)
Function Format ( _
	obj As Object _
) As String

Parameters

obj
Type: System..::.Object
The object to format, may be null.

Return Value

The formatted string, never null and never an empty string.

Remarks

The formatted string may incorporate a variety of presentation techniques intended to clearly identify formatted values of different types. For example, strings might appear quoted, objects might be described using ToString()()() or in terms of their properties, collections might be listed as sequences of formatted elements.

The resulting string should not be expected to be machine-readable.

This method should never return an empty string or throw an exception. If the value cannot be formatted property then a placeholder should be used instead, such as the value's type.

Likewise this method should never throw an exception. If the object cannot be formatted cleanly, then an error message should be produced instead.

These constraints are intended to ensure that the formatter provides a robust service to all clients.

See Also