Is it possible to have a variable with a string format that you would like interpolated.
public class Setting
{
public string Format { get; set; }
}
var setting = new Setting { Format = "The car is {colour}" };
var colour = "black";
var output = $"{setting.Format}";
Expected output
"The car is black".
string.Format. if you have variables and not constants. and you can't have your cake and eat it too.FormatWithor a similar. Be warned that every one of these custom functions has slightly different behavior. See also Named Formats Redux.