• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2077
  • Last Modified:

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
0
ST3VO
Asked:
ST3VO
1 Solution
 
mokuleCommented:
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

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now