Here's the trim() documentation:

http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#trim%28%29