checking for string type before calling trim()
Merge pull request #170 from janeklb/feature-typecheck-in-trim

Checking for string type before calling `trim()`. Closes #169