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
Solved

Search and Replace Characters in a memo

Posted on 2007-11-15
3
1,995 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
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
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…

837 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