Logo

Programming-Idioms

History of Idiom 63 > diff from v32 to v33

Edit summary for version 33 by programming-idioms.org:
[Elixir] +DocURL, +DemoURL

Version 32

2016-11-22, 22:42:14

Version 33

2016-11-30, 21:24:22

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
x2 = String.replace(x, y, z)
Code
x2 = String.replace(x, y, z)
Doc URL
http://elixir-lang.org/docs/stable/elixir/String.html#replace/4
Demo URL
http://play.elixirbyexample.com/s/9b2725b797