Code inspection: Redundant 'object.ToString()' call for value types
This inspection reports a ToString() call on a value type when the surrounding code would convert the value to text anyway. In that case, the explicit call is redundant and makes the expression longer without changing the result.
class C
{
void M(int value)
{
string.Format("{0}", value.ToString());
}
}
class C
{
void M(int value)
{
string.Format("{0}", value);
}
}
13 April 2026