如何在Java中使用StringUtils? [英] How do I use StringUtils in Java?
本文介绍了如何在Java中使用StringUtils?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是Java的初学者。我想使用 StringUtils.replace
但是Eclipse输出StringUtils无法解析
。
I'm a beginner in Java. I want to use StringUtils.replace
but Eclipse outputs "StringUtils cannot be resolved"
.
我试过 import java.lang。*;
,但它不起作用。
I tried import java.lang.*;
, but it doesn't work.
推荐答案
java.lang不包含名为StringUtils的类。有几个第三方库,比如 Apache Commons Lang 或 Spring框架 。确保项目类路径中有相关的jar并导入正确的类。
java.lang does not contain a class called StringUtils. Several third-party libs do, such as Apache Commons Lang or the Spring framework. Make sure you have the relevant jar in your project classpath and import the correct class.
这篇关于如何在Java中使用StringUtils?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文