Logo

Programming-Idioms

History of Idiom 63 > diff from v53 to v54

Edit summary for version 54 by programming-idioms.org:
[Pascal] Imports: one-liner

Version 53

2021-08-19, 06:38:33

Version 54

2021-12-07, 09:49:27

Idiom #63 Replace fragment of a string

Assign to x2 the value of string x with all occurrences of y replaced by z.
Assume occurrences of y are not overlapping.

Idiom #63 Replace fragment of a string

Assign to x2 the value of string x with all occurrences of y replaced by z.
Assume occurrences of y are not overlapping.

Variables
x2,x,y,z
Variables
x2,x,y,z
Extra Keywords
substring substitute
Extra Keywords
substring substitute
Imports
uses
  SysUtils;
Imports
uses SysUtils;
Code
x2 := StringReplace(x, y, z, [rfReplaceAll]);
Code
x2 := StringReplace(x, y, z, [rfReplaceAll]);