Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FormattableString Class

.NET Framework (current version)
 

Represents a composite format string, along with the arguments to be formatted.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

System::Object
  System::FormattableString

public ref class FormattableString abstract : IFormattable

NameDescription
System_CAPS_protmethodFormattableString()

Instantiates a new instance of the FormattableString class.

NameDescription
System_CAPS_pubpropertyArgumentCount

Gets the number of arguments to be formatted.

System_CAPS_pubpropertyFormat

Returns the composite format string.

NameDescription
System_CAPS_pubmethodEquals(Object^)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetArgument(Int32)

Returns the argument at the specified index position.

System_CAPS_pubmethodGetArguments()

Returns an object array that contains one or more objects to format.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticInvariant(FormattableString^)

Returns a result string in which arguments are formatted by using the conventions of the invariant culture.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns the string that results from formatting the composite format string along with its arguments by using the formatting conventions of the current culture. (Overrides Object::ToString().)

System_CAPS_pubmethodToString(IFormatProvider^)

Returns the string that results from formatting the composite format string along with its arguments by using the formatting conventions of a specified culture.

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIFormattable::ToString(String^, IFormatProvider^)

Returns the string that results from formatting the format string along with its arguments by using the formatting conventions of a specified culture.

A composite format string consists of fixed text intermixed with indexed placeholders, called format items, that correspond to the objects in the list. The formatting operation yields a result string that consists of the original fixed text intermixed with the string representation of the objects in the list. Composite formatting is supported by methods such as String::Format, Console::WriteLine, and StringBuilder::AppendFormat. For more information on composite formatting, see Composite Formatting.

A FormattableString instance may result from the an interpolated string in C# or Visual Basic.

Universal Windows Platform
Available since 10
.NET Framework
Available since 4.6

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: