0

再シャープ化は、HtmlTextWriter内のstring.Formatについて不平を言っています。

ここに画像の説明を入力してください

string.formatでHtmlTextWriterを使用するベストプラクティスは何ですか?

少し早いですがお礼を!

4

2 に答える 2

2

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.

于 2012-08-31T17:40:34.643 に答える
1

The Write and WriteLine methods on all of these classes can also take format parameters:

writer.Write("{0} {1}", x, y);
于 2012-08-31T17:40:20.760 に答える