Is there any way to format a string by name rather than position in C#?
In python, I can do something like this example (shamelessly stolen from here):
>>> print '%(language)s has %(#)03d quote types.' % \
{'language': "Python", "#": 2}
Python has 002 quote types.
Is there any way to do this in C#? Say for instance:
String.Format("{some_variable}: {some_other_variable}", ...);
Being able to do this using a variable name would be nice, but a dictionary is acceptable too.
UPDATE: I ended up doing something like this post, but it's definitely not pretty. I'll try out John Sheehan's approach, but if anybody has any other suggestions in the meantime, feel free to add them. :)
UPDATE 2: John Sheehan's approach works pretty well. Accepting it.