Is it possible to add some descriptive text to a string format specifier?
Example:
string.Format ("{0:ForeName} is not at home", person.ForeName);
In the example ForeName
is added as description.
The above syntax is obviously incorrect, but just to show the idea.
The reason I am asking, is because in my case the strings are in a resource file, so in the resource file you currently only see
{0} is not at home
in some cases it is hard to grasp what the context of {0}
is.
EDIT:
In c# 6 string interpolation with the $
operator has been introduced, so string.Format
is not needed anymore:
$"{person.ForeName} is not at home";