remove trailing white-spaces in selected text