Telerik® JustCode™ by Progress

The Fix Format String quick fix command is available for String.Format and StringBuilder AppendFormat methods. It commonly appears when the format items of the composite format string are not zero-based indexed placeholders or there are missing indexes.


Language Support

Supported: C#, VB.NET

Not supported: JavaScript, ASP.NET, XAML, HTML

The behavior can be controlled in Problems option's page - JustCode / Options / Code Analysis / Problems / C#.

When "Invalid format string defined" problem is checked as warning or error in the options dialog, then Telerik® JustCode™ suggests you to use Fix Format String.

To use Fix Format String :

  1. Position the caret inside the undelined string.

  2. Select Fix Format String from the VisualAid's Fixes menu. You can press Alt+Enter in order to expand the Fixes menu.

    Fix Format String selected
  3. The result is (when applied for each expression):

    Fix Format String result

See Also