Replace occurrences of one string with another.
Source position: syshelph.inc line 150
public function TStringHelper.Replace( |
OldChar: char; |
NewChar: char |
):string; overload; |
OldChar: char; |
NewChar: char; |
ReplaceFlags: TReplaceFlags |
):string; overload; |
const OldValue: string; |
const NewValue: string |
):string; overload; |
const OldValue: string; |
const NewValue: string; |
ReplaceFlags: TReplaceFlags |
):string; overload; |
Replace will replace all occurrences of OldChar with NewChar or OldValue with NewValue. The search is case sensitive.
The behaviour of the Replace call can be controlled with the optional ReplaceFlags parameter:
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.
Not specifying the ReplaceFlags parameter is therefore equivalent to specifying [rfReplaceAll].
|
Replace occurrences of one substring with another in a string. |
|
|
Flags for StringReplace function. |