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

Rule:  10@406Checked automatically with code checker

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 {1} specifier designates a missing parameter.