Implementation
Haskell

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
import "strings"
x2 := strings.Replace(x, y, z, -1)
substr($a, 5, 2) = "replacement text";
let x2 = x.replace(&y, &z);
import std.array;
auto x2 = x.replace(y,z);  
uses
  SysUtils;
x2 := StringReplace(x, y, z, [rfReplaceAll]);
var x2 = x.replaceAll(y, z);
x2 = x.gsub(y, z)
x2 = String.replace(x, y, z)
x2 = x.replace(y, z)
String x2 = x.replace(y, z);
string x2 = x.Replace(y, z);
$x2 = str_replace($y, $z, $x);
x2 = x:gsub(y,z)
X2 = binary:replace(X, Y, Z, [global]).
var x2 = x.replace(new RegExp(y, 'g'), z);