trim string to remove trailing whitespace
Merge branch 'feature/bug_17946_space_after_word_fails' into develop