In case you wondered, you can escape curly brackets in a string.Format call by just repeating the brackets. For example, the following:
Console.WriteLine( string.Format( "{{0}}-{0}", 42 ) );
will output:
{0}-42
I needed to do this to use Format to create a string I intended to pass to another Format method. More examples are in a blog post here.
4 comments: (+add yours?)
Aaaarrrggghhh! I wasted an hour on this. Alas. Thanks.
Great!!!! Thanks a LOT
So... how did you solve it? Reading that blog didn't help much.
Thank you very much
Post a Comment