You can also use String.isEmpty() to check for a zero length string since Java 6. I don't know why but they seem to have added a lot of new methods to existing classes in the latest relase that are quite trivial, I guess it's just to make the developers life easier. Methods like isEmpty() exist for many other classes, there isn't really much consistency over the whole API but it's got much better over the past few versions.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.