Because composite format strings are interpreted at runtime, rather than validated by the compiler, they can contain errors that lead to unexpected behaviors or runtime errors. This rule statically validates the good behavior of composite formats when calling the methods of ``++String.Format++``, ``++StringBuilder.AppendFormat++``, ``++Console.Write++``, ``++Console.WriteLine++``, ``++TextWriter.Write++``, ``++TextWriter.WriteLine++``, ``++Debug.WriteLine(String,Object[])++``, ``++Trace.TraceError(String,Object[])++``, ``++Trace.TraceInformation(String,Object[])++``, ``++Trace.TraceWarning(String,Object[])++`` and ``++TraceSource.TraceInformation(String,Object[])++``.
\[~ann.campbell.2] Could you check the issue message? I can't easily find out the number of placeholders in the format, that's why I can't use the same as in Python.
=== on 31 Aug 2015, 13:03:46 Ann Campbell wrote:
\[~tamas.vajk] the message is fine as far as it goes, but it doesn't cover something like this:
----
var s1 = string.Format("{3}", 1);
----
=== on 18 Jan 2016, 11:05:13 Ann Campbell wrote:
This should eventually cover ``++Console.WriteLine++`` (and some others, I'm told) too.