情景描述:

有的场景我们存的是String字符串但是不能每次都固定的实体进行封装,这时候我们如果直接返回给前端对应的字符串,其中就会出现对应的 "\ 的转义符号,如何去掉呢?

解决方法

在获取到对应的数据后进行一步转换,一般在set方法中添加即可。

   LinkedHashMap<String, Object> stringObjectLinkedHashMap = new JSONParser(requestParam).parseObject();

如果你有好的办法 欢迎来交流。

GitHub 加速计划 / js / json
54
5
下载
适用于现代 C++ 的 JSON。
最近提交(Master分支:23 天前 )
2d9a2512 19 小时前
3cca3ad2 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.17 to 3.28.18. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/60168efe1c415ce0f5521ea06d5c2062adbeed1b...ff0a06e83cb2de871e5a09832bc6a81e7276941f) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.28.18 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 4 天前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐