All Memo Text in one Line

I have a memo with some lines , like this :

Name : Richard Jakson
Age : 35
Adress : 5th Avenue

and i want like this

Name : Richard Jakson Age : 35 Adress : 5th Avenue

can someone help me ??? thnx a lot
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

  res : String;
  i : Integer;
  res := '';
  for i := 0 to memo.lines.count - 1 do
    res := res + memo.lines[i];

procedure TForm1.Button1Click(Sender: TObject);
  memo1.Text := stringReplace(memo1.text,#13#10,' ',[rfReplaceAll]);

meikl ;-)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Both those solutions will most likely work.
Both will alter the contents of your memo to be in one line.

But if memo1.wordwrap is true, you will see it on screen as many lines unless your memo1.width is big enough to fit the whole lenght of the text. If you set it to false, then the text will go beyond the edge and you will have to scroll.

However if you want to process the text in your memo  as a single line while showing it on the screen as many lines, then you should make use of memo1.text. It has all the text in one single string. It's good for many applications such as storing it in a file where you already have other contents. (If you want to put only the contents of a single TMemo in a file, you use memo1.lines.SaveToFile, and then memo1.lines.LoadFromFile to get it back).

Hope it helps:


Use Memo1.Lines.Text .


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.