C#中String.Format格式化json中包含"{" "}"報錯問題解決 分類:C#.Net 作者:Format 日期:2016-06-20 15:05 閱讀:21640 C#中String.Format格式化json中包含"{" "}"報錯問題解決 json.Append(String.Format("{\"total\":{0},\"col\":{1}}", Count, strJSON));直接會報錯 字符串中包含{或者},則需要用{{ 來代替字符 {,用}} 代替 } 如:json.Append(String.Format("{{\"total\":{0},\"col\":{1}}}", Count, strJSON)); 原文鏈接: