Reputation: 62300
Resharping is complaning about string.Format inside HtmlTextWriter.
What will be the best practice using HtmlTextWriter with string.format?
Thank in advance!
Upvotes: 0
Views: 603
Reputation: 888185
The Write
and WriteLine
methods on all of these classes can also take format parameters:
writer.Write("{0} {1}", x, y);
Upvotes: 1
Reputation: 29996
The point is that you do not need to use string.Format. You can just do this:
writer.Write("{0}",1);
See: http://msdn.microsoft.com/en-us/library/acsz4w2k.aspx
HtmlTextWriter.Write Method (String, Object[])
Writes a formatted string that contains the text representation of an object array to the output stream, along with any pending tab spacing. This method uses the same semantics as the String.Format method.
Upvotes: 2