Re: string.Format and curly braces

2011-02-03 Thread Noon Silk
On Fri, Feb 4, 2011 at 12:02 PM, David Kean david.k...@microsoft.com wrote: I’m really interested in the scenario where you are passing user input as the format string – do you have user input with placeholders ({0}) that you need to fill? His problem is double formatting. Something like:

Re: string.Format and curly braces

2011-02-02 Thread Grant Maw
Does this help? http://geekswithblogs.net/jonasb/archive/2007/03/05/108023.aspx On 3 February 2011 15:42, Greg Keogh g...@mira.net wrote: Back to coding ... I diagnosed an app crash today caused by an argument to string.Format having curly braces inside it. I was doing something like

RE: string.Format and curly braces

2011-02-02 Thread David Kean
You don't have to escape arguments, for example, below shouldn't crash on any version of .NET . We you perhaps instead passing user input as the format string instead? That you will have to escape. From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Greg

RE: string.Format and curly braces

2011-02-02 Thread Greg Keogh
You don't have to escape arguments, for example, below shouldn't crash on any version of .NET . We you perhaps instead passing user input as the format string instead? That you will have to escape. Oops! Sorry, you're right, I had it backwards. The format string contains {Intention} not the