I ran into some code that has the following:
String foo = getvalue("foo");
if (StringUtils.isBlank(foo))
doStuff();
else
doOtherStuff();
This appears to be functionally equivalent to the following:
String foo = getvalue("foo");
if (foo.isEmpty())
doStuff();
else
doOtherStuff();
Is a difference between the two (org.apache.commons.lang3.StringUtils.isBlank
and java.lang.String.isEmpty
)?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…