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
Post a Comment