Logo

Programming-Idioms

History of Idiom 63 > diff from v35 to v36

Edit summary for version 36 by looeee:
New JS implementation by user [looeee]

Version 35

2019-09-26, 18:37:54

Version 36

2019-09-27, 05:56:38

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