为什么不推荐使用 org.apache.common.lang3 StringEscapeUtils?

新手上路,请多包涵
阅读 1.9k
3 个回答

该类已从包中移出

org.apache.commons。 lang3

org.apache.commons。 文本

您可以轻松替换已弃用的库:

在你的 build.gradle 中:

 implementation 'org.apache.commons:commons-text:1.9'

在您的课堂上使用 StringEscapeUtils 确保导入正确的课程:

 import org.apache.commons.text.StringEscapeUtils;

1.9 目前是最新版本(最后一次检查是 2021 年 2 月 24 日),但您可以在 Maven 上检查版本: https ://mvnrepository.com/artifact/org.apache.commons/commons-text

原文由 Björn Kechel 发布,翻译遵循 CC BY-SA 4.0 许可协议

新手上路,请多包涵

可以直接到apache commons 中的doc查看,开头写了“as of 3.6, use commons-text StringEscapeUtils instead” 使用commons-text 替代了

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题