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

pentaho - Carte Status / Kettle Slave Server Status page shows status for random runs instead of the latest run -

R summary function in ddply (plyr) in a simple way -

c# - Are delegates created via lambda expressions guaranteed to be cached? -