TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
C# Coding Standard

Rule:  10@406Checked automatically with code checker

Synopsis:When using composite formatting, do supply all objects referenced in the format string
Severity Level:1
Category:Data types


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.


Console.WriteLine("The value is {0} and not {1}", i);

where the {1} specifier designates a missing parameter.