TStringHelper.Replace

Replace occurrences of one string with another.

Declaration

Source position: syshelph.inc line 150

public 
  function Replace(OldChar: Char; NewChar: Char) : string;  Overload;
  function Replace(OldChar: Char; NewChar: Char; 
                  ReplaceFlags: TReplaceFlags) : string;  Overload;
  function Replace(const OldValue: string; const NewValue: string)
                   : string;  Overload;
  function Replace(const OldValue: string; const NewValue: string; 
                  ReplaceFlags: TReplaceFlags) : string;  Overload;

Description

Replace will replace occurrences of OldChar with NewChar or OldValue with NewValue.

If rfReplaceAll is in the ReplaceFlags, then all occurrences will be replaced, otherwise only the first occurrence is replaced.

If rfCaseInsensitive is in the ReplaceFlags, then the search for OldChar or OldValue is performed ignoring case.

See also

Name Description
StringReplace Replace occurrences of one substring with another in a string.
TReplaceFlags Flags for StringReplace function