kxkpmulp1#
问题:一个结构为:{"itemId":"SP0000982","notSupportSkuList":{"lease":[]},"operateType":"onShelf","userId":"EMq6NMsNT","userName":"xtt"} 的Object,直接调用.toString()方法时,结果为:"{"itemId":"SP0000982","notSupportSkuList":{"lease":[]},"operateType":"onShelf","userId":"EMq6NMsNT","userName":"xtt"} ",但是调用fastjson的JSON.toJSONString(Object object)时返回值为""{"itemId":"SP0000982","notSupportSkuList":{"lease":[]},"operateType":"onShelf","userId":"EMq6NMsNT","userName":"xtt"} "",额外套了一层双引号,是SerializeWriter的writeStringWithDoubleQuote(String text, final char seperator)方法里buf[]数组开头和结尾添加了引号,这个引号是否可以去掉?
1条答案
按热度按时间kxkpmulp1#
问题:一个结构为:{"itemId":"SP0000982","notSupportSkuList":{"lease":[]},"operateType":"onShelf","userId":"EMq6NMsNT","userName":"xtt"} 的Object,直接调用.toString()方法时,结果为:"{"itemId":"SP0000982","notSupportSkuList":{"lease":[]},"operateType":"onShelf","userId":"EMq6NMsNT","userName":"xtt"} ",但是调用fastjson的JSON.toJSONString(Object object)时返回值为""{"itemId":"SP0000982","notSupportSkuList":{"lease":[]},"operateType":"onShelf","userId":"EMq6NMsNT","userName":"xtt"} "",额外套了一层双引号,是SerializeWriter的writeStringWithDoubleQuote(String text, final char seperator)方法里buf[]数组开头和结尾添加了引号,这个引号是否可以去掉?