FormattableString FormattableString FormattableString FormattableString Class

Definition

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

public ref class FormattableString abstract : IFormattable
public abstract class FormattableString : IFormattable
type FormattableString = class
    interface IFormattable
Public MustInherit Class FormattableString
Implements IFormattable
Inheritance
FormattableStringFormattableStringFormattableStringFormattableString
Implements

Remarks

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 an interpolated string in C# or Visual Basic.

Constructors

FormattableString() FormattableString() FormattableString() FormattableString()

Instantiates a new instance of the FormattableString class.

Properties

ArgumentCount ArgumentCount ArgumentCount ArgumentCount

Gets the number of arguments to be formatted.

Format Format Format Format

Returns the composite format string.

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetArgument(Int32) GetArgument(Int32) GetArgument(Int32) GetArgument(Int32)

Returns the argument at the specified index position.

GetArguments() GetArguments() GetArguments() GetArguments()

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

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
Invariant(FormattableString) Invariant(FormattableString) Invariant(FormattableString) Invariant(FormattableString)

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

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() 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.

ToString(IFormatProvider) ToString(IFormatProvider) ToString(IFormatProvider) ToString(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.

Explicit Interface Implementations

IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider) IFormattable.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.

Applies to

See Also