Need help with String.Format


hi.

i have issue, need format string.

here's problem causing code snippet:
string formatstring = "mystring{{0},{1}}";
string arg1 = "value1";
string arg2 = "value2";
string result = string.format(formatstring, arg1, arg2);

result should "mystring{value1,value2}", formatexception.

so can see problem lies, string.format  -method cannot handle format string. how can use format strings while @ same time include additional curly brackets result?

to include curly braces in formatted string, need type them twice in format string: string formatstring = "mystring{{{0},{1}}}";


Archived Forums V  >  Visual C# Language



Comments

Popular posts from this blog

SQL Server 2008 - High Memory Usage

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

Problem In Configuring Biztalk 2009 In Creating A ReceivePort.When I Try To Create A Receive POrt I Got This Error