ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Code inspection: String formatting method problems

Last modified: 11 February 2024

This inspection verifies that format items in the format argument of the String.Format and similar methods are used correctly.

If you have a custom formatting method that behaves like String.Format, you can mark it with the [StringFormatMethodAttribute] from JetBrains.Annotations to enable the corresponding checks. Here is an example: