Logo

Programming-Idioms

History of Idiom 63 > diff from v41 to v42

Edit summary for version 42 by programming-idioms.org:
[Elixir] Dead link: play.elixirbyexample.com has been down for a while

Version 41

2019-10-01, 22:19:17

Version 42

2019-10-14, 12:26:12

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
Doc URL
http://elixir-lang.org/docs/stable/elixir/String.html#replace/4
Demo URL
http://play.elixirbyexample.com/s/9b2725b797