If the instance being placed in this spot supports IFormattable, the IFormattable.
ToString method is called with a Nothing format specifier, which usually is the same if you had
supplied the "G", or general, format specifier. Incidentally, within the source string, if you need
to insert actual braces that will show in the output, you must double them by putting in either
{{ or }}.
The exact format of the replacement item is {index[,alignment][:formatString]}, where
the items within brackets are optional. The index value is a zero-based value used to reference
one of the trailing parameters provided to the method. The alignment represents how wide
the entry should be within the composite string. For example, if you set it to eight characters
in width and the string is narrower than that, then the extra space is left-padded with spaces.
Last, the FormatString portion of the replacement item allows you to denote precisely what
formatting to use for the item. The format string is the same style of string that you would
have used if you were to call IFormattable.ToString() on the instance itself. Unfortunately,
you can??™t specify a particular IFormatProvider instance for each one of the replacement
strings. If you need to create a composite string from items using multiple format providers or
cultures, you must resort to using IFormattable.
Pages:
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297