Implemented trim() function.
Bugfix: extractByLine() does not throw exceptions anymore when faced with an empty last line.