Doesn't the `trim()` take care of the trailing whitespace?