Search and Replace Characters in a memo

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
ST3VOAsked:
Who is Participating?
 
mokuleConnect With a Mentor Commented:
Hi

  Memo1.Text := StringReplace( Memo1.Text,'*',',',[rfReplaceAll]);
0
 
Tomas Helgi JohannssonCommented:
   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
 
ST3VOAuthor Commented:
Perfect Thanks!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.