JS - JSON 单双引号互换

1. 双引号转换为单引号

JSON.stringify(data).replace(/\"/g,"'");  

2. 单引号转换为双引号

data.replace(/'/g, '"');  

 

 

原文出处 : https://blog.csdn.net/weixin_33845881/article/details/85861807

posted @ 2020-05-12 23:20  武卡卡  阅读(1793)  评论(0编辑  收藏  举报