Хорошо. Я пробовал все, чтобы отобразить дату в формате Apr'11 с помощью метода DateTime ToString
. В документации указано, что '
зарезервирован для строкового литерала, поэтому я бы подумал, что должен отображать один апостроф, который я использовал бы '''
. Однако не нужно идти. Вот что я пробовал до сих пор:
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
Серьезно, какой секрет? Я отказываюсь конкатенировать!