Refering to this link
http://msdn.microsoft.com/en-us/library/b1csw23d.aspx
it seems that it is not possible with the String.Format method to use labels instead of indices in the format string parameter.
Is there some syntax or functionality native to the .Net Framework that allows using labels instead of 0,1,...,N ?
As an example, how can this:
Console.WriteLine(String.Format("{0}{1}{0}{1}", "foo", "bar"));
become something like this:
Console.WriteLine(String.Format("{foo}{bar}{foo}{bar}",
new { foo = "foo", bar = "bar" }));