Remove leading and trailing spaces on check word count