fix(chore): Remove code duplication (Issue #2890 Fix)

Fixed issue #2890 by removing code duplication.

The stripWhitespace function, which is the exact same as the trim function, is not even used, so it was removed.