[Solved]How to remove the spaces before and after two words but not remove the space between the two words?
-
Hi everyone,
I have difficulty in solving the above problem.
I had encountered a problem in removing the space between the words.For example, when I put " <spaces> Hi everyone <spaces> ", I want only to get the string "Hi everyone".
I came across this function, "setInputMask".
But it still doesn't solve my problem.
Can anyone help me?
Maybe you can give some clue or explain on how exactly this function works?Btw, this is my code snippet:
@
ui->lineEdit->setInputMask("nnnnn");
if (ui->lineEdit->text()== NULL)
{
QMessageBox::warning(this,tr("Warning"),
tr("NULL"),
QMessageBox::Ok) ;
return;
}
else
ui->textBrowser->setText(ui->lineEdit->text());
@ -
Hi,
Are you thinking of something like QString::trimmed() ?
-
Yup, SGaist.
Thanks for the suggestion.
That's really helps me. :) -
ok, thanks Andre...