Solved

Search and Replace Characters in a memo

Posted on 2007-11-15
3
2,003 Views
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?

Thanks

ST3VO
0
Comment
Question by:ST3VO
[X]
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
3 Comments
 
LVL 17

Accepted Solution

by:
mokule earned 500 total points
ID: 20288045
Hi

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

Expert Comment

by:Tomas Helgi Johannsson
ID: 20288053
   Hi!

You could do it like this

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

and call the function like
  ReplaceText(Memo1,'*',',');

Regards,
   Tomas Helgi

0
 

Author Closing Comment

by:ST3VO
ID: 31409300
Perfect Thanks!!!
0

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 (https://www.experts-exchange.com/questions/29008360/) 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