Jump to content

How to remove empty last line in TUniMemo?


rgreat

Recommended Posts

Hi,

 

Well, as you know, this is "default behavior" of "Memo VCL", this line will be ignored when called "Count"

If you delete a "line break", the behavior UniMemo1.Lines.Add will be different, the text will be added to the end of the line...

 

Best regards.

Link to comment
Share on other sites

  • 5 years later...
11 minutes ago, Daha Software said:

image.png.31ccbc7ec3e639048e6ee1adef20da21.png

 

On 1/13/2016 at 8:58 PM, Sherzod said:

Well, as you know, this is "default behavior" of "Memo VCL", this line will be ignored when called "Count"

If you delete a "line break", the behavior UniMemo1.Lines.Add will be different, the text will be added to the end of the line...

 

On 1/13/2016 at 10:47 PM, rgreat said:

Ok, i used workaround...

procedure TProgressDlg.AddToLog(Text: string);
begin
  Memo1.Lines.Insert(0,Text);
end;

 

Link to comment
Share on other sites

On 9/10/2021 at 7:39 PM, Daha Software said:

TrimLeft(TrimRight(UniMemo4.Lines.Text)); 

1. This is equal to Trim(UniMemo4.Lines.Text)

2. TrimLeft is unsafe. It will remove leading spaces in the first line, for example. That's why I only used TrimRight instead of Trim.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...