Synopsis: | When using composite formatting, do supply all objects referenced in the format string |
Language: | C# |
Severity Level: | 1 |
Category: | Data types |
Description: |
Composite formatting, e.g. in String.Format, uses indexed placeholders that must correspond to elements in the list of values. A runtime exception results if a parameter specifier designates an item outside the bounds of the list of values, and we prefer not to have runtime exceptions. Example:
Console.WriteLine("The value is {0} and not {1}", i); where the |