History of Idiom 63 > diff from v48 to v49
Edit summary for version 49 by programming-idioms.org:
[Rust] DemoURL with gist
[Rust] DemoURL with gist
↷
Version 48
2020-05-14, 12:26:50
Version 49
2021-03-25, 17:50:06
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,zVariables
x2,x,y,zExtra Keywords
substring substituteExtra Keywords
substring substituteDemo URL
https://play.rust-lang.org/?code=fn%20main()%20%7B%0A%20%20%20%20let%20x%20%3D%20%22lorem%20ipsum%20dolor%20lorem%20ipsum%22%3B%0A%20%20%20%20let%20y%20%3D%20%22lorem%22%3B%0A%20%20%20%20let%20z%20%3D%20%22LOREM%22%3B%0A%0A%20%20%20%20let%20x2%20%3D%20x.replace(%26y%2C%20%26z)%3B%0A%20%20%20%20%0A%20%20%20%20println!(%22%7B%7D%22%2C%20x2)%3B%0A%7D%0A&version=stable
Comments bubble
Comments bubble