==[[C# 書式]]==[[C Sharp]] | {{category [[Category:書式}}]]
===String.Format===
====複合書式指定文字列 ====
"(N) Number: . . . . . . . . . {0:N}\n" +
"(P) Percent:. . . . . . . . . {1:P}\n" +
"([[R]]) Round[[R]]ound-trip: . . . . . . . {1:[[R]]}\n" +
"(X) Hexadecimal:. . . . . . . {0:X}\n",
-123, -123.45f);
" (default):. . . . . . . . {0} (default = 'G')\n" +
"(M) Month:. . . . . . . . . . {0:M}\n" +
"([[R]]) RFC1123[[R]]FC1123:. . . . . . . . . {0:[[R]]}\n" +
"(s) Sortable: . . . . . . . . {0:s}\n" +
"(u) Universal sortable: . . . {0:u} (invariant)\n" +
(N) Number: . . . . . . . . . -123.00
(P) Percent:. . . . . . . . . -12,345.00 %
([[R]]) Round[[R]]ound-trip: . . . . . . . -123.45
(X) Hexadecimal:. . . . . . . FFFFFF85
(default):. . . . . . . . 6/26/2004 8:11:04 PM (default = 'G')
(M) Month:. . . . . . . . . . June 26
([[R]]) RFC1123[[R]]FC1123:. . . . . . . . . Sat, 26 Jun 2004 20:11:04 GMT
(s) Sortable: . . . . . . . . 2004-06-26T20:11:04
(u) Universal sortable: . . . 2004-06-26 20:11:04Z (invariant)