Link to home
Start Free TrialLog in
Avatar of ST3VO
ST3VOFlag for United Kingdom of Great Britain and Northern Ireland

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of mokule
mokule
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tomas Helgi Johannsson
   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

Avatar of ST3VO

ASKER

Perfect Thanks!!!