The JDK's String.trim() method is pretty naive, and only removes ascii control characters.
Apache Commons' StringUtils.strip() is slightly better, but uses the JDK's Character.isWhitespace(), which doesn't recognize non-breaking space as whitespace.
So what would be the most complete, Unicode-compatible, safe and proper way to trim a string in Java?
And incidentally, is there a better library than commons-lang
that I should be using for this sort of stuff?