如何使用c#以json格式添加新行

时间:2017-03-02 11:49:03

标签: c# json newline line-breaks

我使用c#

从数据库获取数据
subscriptionDetailInfo.SubscriptionDescription = item.SubscriptionDescription

输出将是json,如下所示

"SubscriptionDescription":"Before you can. begin to determine what. the composition of. a particular",

现在我需要更换"。"到新线。

我所需的输出将是这样的

"SubscriptionDescription":"Before you can
 begin to determine what
 the composition of
 a particular",

我尝试使用以下方法但不能正常工作

 subscriptionDetailInfo.SubscriptionDescription = item.SubscriptionDescription.Replace(".", "/\n / g").Replace("/\n / g", "\\n")

结果输出如下

"SubscriptionDescription":"Before you can\\n begin to determine what\\n the composition of\\n a particular",

0 个答案:

没有答案