0
I have an application that by clicking on labels
one edit
receives his caption
as follows:
Edit1.Text := Edit1.Text + TLabel(Sender).caption+ ' ';
After that I click ok, and this information passes to a memo
.
However the problem appears now by clicking ok that code sends the data to memo
:
Memo1.Lines.add(' '+'if'+' '+ cond1+':');
The memo
receives the following value for example:
if dose > 0 :
You can notice that after 0 there is a space, I would like to remove it so that it is as follows:
if dose > 0:
Try using Trimleft, Trimright, or Trim to remove the blanks.
– RBoschini
do not want to remove all whitespace just what I indicated in the question
– Guilherme Lima
See if it can help you adapt your question. http://www.devmedia.com.br/forum/deletar-ultimo-caracter-de-umastring/158822
– Marconi
If your if had something like
if dose > 01:
he would have to remove the 1?– Marconi
Trimleft or Trimright does not remove all blank spaces from the string.
– RBoschini
Thanks @Rboschini the Trimright function solved my problem.
– Guilherme Lima