Writes the text representation of the specified array of objects, followed by the current line terminator, to the standard output stream using the specified format information.
Type Reason ArgumentNullException format or arg is null. System.IO.IOException An I/O error occurred. FormatException The format specification in format is invalid.
-or-
The number indicating an argument to be formatted is less than zero, or greater than or equal to arg.Length .
This method uses the composite formatting feature of the .NET Framework to convert the value of an object to its text representation and embed that representation in a string. The resulting string is written to the output stream.
The format parameter consists of zero or more runs of text intermixed with zero or more indexed placeholders, called format items, that correspond to an object in the parameter list of this method. The formatting process replaces each format item with the text representation of the value of the corresponding object.
The syntax of a format item is {index[,alignment][:formatString]}, which specifies a mandatory index, the optional length and alignment of the formatted text, and an optional string of format specifier characters that govern how the value of the corresponding object is formatted.
The .NET Framework provides extensive formatting support, which is described in greater detail in the following formatting topics.
For more information about the composite formatting feature supported by methods such as erload:System.String.Format, erload:System.Text.StringBuilder.AppendFormat, and some overloads of erload:System.Console.WriteLine, see Composite Formatting.
For more information about numeric format specifiers, see Standard Numeric Format Strings and Custom Numeric Format Strings.
For more information about date and time format specifiers, see Standard DateTime Format Strings and Custom DateTime Format Strings.
For more information about enumeration format specifiers, see Enumeration Format Strings.
For more information about formatting, see Formatting Types.
For more information about the line terminator, see the Remarks section of the Console.WriteLine method that takes no parameters.