I know that we can use a format specifier for string interpolation in C#6
var someString = $" the date was ... {_criteria.DateFrom:dd-MMM-yyyy}";
However I am using the same format in the same method over and over again so would like to soft code it, but not sure how to do it, or even if its possible,
DateTime favourite;
DateTime dreaded;
...
...
const string myFormat = "dd-MMM-yyyy";
var aBigVerbatimString = $@"
my favorite day is {favourite:$myFormat}
but my least favourite is {dreaded:$myFormat}
blah
blah
";
Can someone tell me how to do it, or confirm to me its impossible as I have done some reading and found nothing to suggest its possible