You may be confusing String.trim() and Iterator.remove().
You would want access to the iterator to remove items from the list. Invoking trim on a
string will return a new string instance that has been trimmed (white space removed from the front and back).
To get access to the iterator, you use the old form (pre
Java 5) of the for loop.