Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​FormattableString

Assembly: System.Runtime

Inheritance: object → FormattableString

Implemented Interfaces

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

Properties

public int
ArgumentCount
Gets the number of arguments to be formatted.
public string
Format
Returns the composite format string.

Methods

public static string
CurrentCulture​(FormattableString formattable)
Returns a result string in which arguments are formatted by using the conventions of the current culture.
Returns The string that results from formatting the current instance by using the conventions of the current culture.
formattable The string to be formatted.
public object
GetArgument​(int index)
Returns the argument at the specified index position.
Returns The argument.
index The index of the argument. Its value can range from zero to one less than the value of <see cref="P:System.FormattableString.ArgumentCount" /> .
public object[]
GetArguments​()
Returns an object array that contains one or more objects to format.
Returns An object array that contains one or more objects to format.
public static string
Invariant​(FormattableString formattable)
Returns a result string in which arguments are formatted by using the conventions of the invariant culture.
Returns The string that results from formatting the current instance by using the conventions of the invariant culture.
formattable The object to convert to a result string.
public string
ToString​()
Returns the string that results from formatting the composite format string along with its arguments by using the formatting conventions of the current culture.
Returns A result string formatted by using the conventions of the current culture.
public string
ToString​(IFormatProvider? formatProvider)
Returns the string that results from formatting the composite format string along with its arguments by using the formatting conventions of a specified culture.
Returns A result string formatted by using the conventions of <paramref name="formatProvider" /> .
formatProvider An object that provides culture-specific formatting information.
public bool
Equals​(object obj)
Inherited from object
Determines whether the specified object is equal to the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
obj The object to compare with the current object.
protected void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public int
GetHashCode​()
Inherited from object
Serves as the default hash function.
Returns A hash code for the current object.
public Type
GetType​()
Inherited from object
Gets the <see cref="T:System.Type" /> of the current instance.
Returns The exact runtime type of the current instance.
protected object
MemberwiseClone​()
Inherited from object
Creates a shallow copy of the current <see cref="T:System.Object" /> .
Returns A shallow copy of the current <see cref="T:System.Object" /> .