A format item has the following syntax:
{index[,alignment][ : formatString] }
Brackets denote optional elements. The opening and closing brackets are required. A format item has the following elements:
- index
The zero-based index of the argument whose string representation is to be included at this position in the string. If the argument is null, an empty string is included at this position in the string.
- alignment
A signed integer that indicates the total length of the field into which the argument is inserted and whether it is right-aligned (a positive integer) or left-aligned (a negative integer). If alignment is omitted, the string representation of the corresponding argument is inserted in a field with no leading or trailing spaces.
- formatString
A format string that specifies the format of the corresponding argument's result string. If
formatString is omitted, the corresponding argument's parameterless
ToString method is called to produce its string representation. If
formatString is present, the argument referenced by the format item must implement the
IFormattable interface. Types that support format strings include the following:
원문
댓글
댓글 쓰기