Trim spaces when processing inputs of certain dialogs