{ "commentId": null, "commentUserId": null, "commentUserName": null, "commentContent": null, "commentPic": null, "commentSource": null, "commentType": null, "mId": null, "pId": null } 转成JSONString
时间: 2023-07-03 12:31:44 浏览: 72
以下是该JSON转成JSON字符串的示例代码(以Java为例):
```java
import com.alibaba.fastjson.JSONObject;
public class Main {
public static void main(String[] args) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("commentId", null);
jsonObject.put("commentUserId", null);
jsonObject.put("commentUserName", null);
jsonObject.put("commentContent", null);
jsonObject.put("commentPic", null);
jsonObject.put("commentSource", null);
jsonObject.put("commentType", null);
jsonObject.put("mId", null);
jsonObject.put("pId", null);
String jsonString = jsonObject.toString();
System.out.println(jsonString);
}
}
```
输出结果为:
```
{"commentId":null,"commentUserId":null,"commentUserName":null,"commentContent":null,"commentPic":null,"commentSource":null,"commentType":null,"mId":null,"pId":null}
```
阅读全文