I have two constants:
public const string DateFormatNormal = "MMM dd";
public const string TimeFormatNormal = "yyyy H:mm";
after I decided to have another permanent base for these two:
public const string DateTimeFormatNormal = String.Format("{0} {1}", DateFormatNormal, TimeFormatNormal);
But I get a compilation error The expression being assigned to 'Constants.DateTimeFormatNormal' must be constant
After I try to do this:
public const string DateTimeFormatNormal = DateFormatNormal + " " + TimeFormatNormal;
It works with + " " +, but I still prefer to use something similar to String.Format("{0} {1}", ....)any thoughts, how can I make it work?
source
share