FormattableString Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
-
FormattableString
- Implements
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.
Formattable |
Instantiates a new instance of the FormattableString class. |
Argument |
Gets the number of arguments to be formatted. |
Format |
Returns the composite format string. |
Current |
Returns a result string in which arguments are formatted by using the conventions of the current culture. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Get |
Returns the argument at the specified index position. |
Get |
Returns an object array that contains one or more objects to format. |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Invariant(Formattable |
Returns a result string in which arguments are formatted by using the conventions of the invariant culture. |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
To |
Returns the string that results from formatting the composite format string along with its arguments by using the formatting conventions of the current culture. |
To |
Returns the string that results from formatting the composite format string along with its arguments by using the formatting conventions of a specified culture. |
IFormattable. |
Returns the string that results from formatting the format string along with its arguments by using the formatting conventions of a specified culture. |
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.3, 1.4, 1.5, 1.6, 2.0, 2.1 |
UWP | 10.0 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: