c# - System.FormatException of a string -


this question has answer here:

i'm getting system.formatexception: input string not in correct format when running method.

the values of fields:

arrayname = "requester"; fieldlist = "\"name\" : \"shimshon\""; // "name" : "shimshon"   public override string tostring() {    var val = string.format("\"{0}\" : { {1} }", arrayname, fieldlist);     return val; } 

the expect result of method is

"requester" : { "name" : "shimshon" } 

what wrong format?

i think want:

var val = string.format("\"{0}\" : {{ {1} }}", arrayname, fieldlist); 

note doubled {{ , }} escape sequence necessary braces literally output.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -