We already suggest a code fix for string.Format (on CC0048) to use string interpolation. Let's suggest one for Console.WriteLine.
Should work with:
WriteLine(String, Object)
WriteLine(String, Object[])
WriteLine(String, Object, Object)
WriteLine(String, Object, Object, Object)
WriteLine(String, Object, Object, Object, Object)
This:
Console.WriteLine("some {0} text", adjective);
Becomes:
Console.WriteLine($"some {adjective} text");
Category: Style
Severity: Info
Diagnostic id: CC0095
More info on Console.WriteLine on MSDN.
We already suggest a code fix for
string.Format(onCC0048) to use string interpolation. Let's suggest one forConsole.WriteLine.Should work with:
WriteLine(String, Object)WriteLine(String, Object[])WriteLine(String, Object, Object)WriteLine(String, Object, Object, Object)WriteLine(String, Object, Object, Object, Object)This:
Becomes:
Category:
StyleSeverity:
InfoDiagnostic id:
CC0095More info on
Console.WriteLineon MSDN.