Logo

Programming-Idioms

History of Idiom 63 > diff from v42 to v43

Edit summary for version 43 by programming-idioms.org:
Admin deletes impl 3180: First occurrence only: doesn't work for this task, see idiom statement

Version 42

2019-10-14, 12:26:12

Version 43

2019-10-16, 12:13:23

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.

Extra Keywords
substring substitute
Extra Keywords
substring substitute
Code
string.replace( x, y )
Comments bubble
replaces first occurrence of x with y