transform : String -> StringTransforms the given string in the following way:
* on every line, trailing whitespace characters are removed
* makes sure the string ends with exactly one newline character
Note: So far, a newline character corresponds to `'\n'`.