我遇到了一些具有以下内容的代码:
String foo = getvalue("foo");
if (StringUtils.isBlank(foo))
doStuff();
else
doOtherStuff();
Run Code Online (Sandbox Code Playgroud)
这看起来在功能上等同于以下内容:
String foo = getvalue("foo");
if (foo.isEmpty())
doStuff();
else
doOtherStuff();
Run Code Online (Sandbox Code Playgroud)
两者(org.apache.commons.lang3.StringUtils.isBlank和java.lang.String.isEmpty)之间有区别吗?