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

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'