Adds helper method to trim string whitespaces (trailing and ending).