String.Format in C#

One of the painful things about good old ASP was string formatting, VBScript simply didn't have anything useful. C# (and VB.Net) do, but MSDN doesn't provide a quick reference to the formatting options. To compare string formatting in C# to those in C lets have an example, Code: char szOutput[256]; sprintf(szOutput, "At loop position %d.\n", i); sprintf takes an output buffer, a format string and any number of arguments to substitute into the format string. The C# equivalent for sprintf more [...]

Date formatting and Custom date formatting

Date formatting Specifier type output (June 8, 1970 12:30:59) d Short Date 08/06/1970 D Long Date 08 June 1970 t Short Time 12:30 T Long Time 12:30:59 f Full date and time 08 June 1970 12:30 F Full date and time (long) 08 June 1970 12:30:59 g Default date and time 08/06/1970 12:30 G Default date and time (long) 08/06/1970 12:30:59 M Day / Month 8 June r RFC1123 date string Mon, 08 Jun 1970 12:30:59 GMT s Sortable more [...]