Ok I’ve tried everything to render a date in the Apr ’11 format with the DateTime ToString method. The documentation says ' is reserved for a string literal, so I would think to display a single apostrophe I’d use ''' – However, no go. Here’s what I’ve tried so far:
taskdata.Month.Start.ToString("MMM 'yy")
A first chance exception of type 'System.FormatException' occurred in mscorlib.dll
taskdata.Month.Start.ToString("MMM ''yy")
"Apr 09"
taskdata.Month.Start.ToString("MMM '''yy")
A first chance exception of type 'System.FormatException' occurred in mscorlib.dll
taskdata.Month.Start.ToString("MMM ''''yy")
"Apr 09"
taskdata.Month.Start.ToString("MMM \'yy")
A first chance exception of type 'System.FormatException' occurred in mscorlib.dll
taskdata.Month.Start.ToString("MMM '\''yy")
A first chance exception of type 'System.FormatException' occurred in mscorlib.dll
Seriously what’s the secret? I refuse to concatenate!
You need to escape (double escape, actually):