Search and Replace Characters in a memo

Posted on 2007-11-15
Last Modified: 2012-08-13
Hi experts!

I have a memo which contains '*'  characters.

I need to search for those characters and replace them with a ',' character (comma)

Could you please help?


Question by:ST3VO
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 17

Accepted Solution

mokule earned 500 total points
ID: 20288045

  Memo1.Text := StringReplace( Memo1.Text,'*',',',[rfReplaceAll]);
LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 20288053

You could do it like this

procedure ReplaceText( var M : TMemo; strOLD, strNEW: string);
  M := StringReplace(M.Lines.Text, strOLD, strNEW, [rfReplaceAll]);

and call the function like

   Tomas Helgi


Author Closing Comment

ID: 31409300
Perfect Thanks!!!

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
code issue 8 188
Delphi Form ownership 4 127
TServerSocket - file via sendbuf or Text via sendtext ? 1 76
can i put an image from resource into image tag ? 6 32
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question ( here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question