Skip to content

Instantly share code, notes, and snippets.

@alexdumont
Created December 23, 2014 16:02
Show Gist options
  • Save alexdumont/8cc96dcdf43fed80a897 to your computer and use it in GitHub Desktop.
Save alexdumont/8cc96dcdf43fed80a897 to your computer and use it in GitHub Desktop.
str_replace
function Remplace(a,b, expr) {
var i=0
while (i!=-1) {
i=expr.indexOf(a,i);
if (i>=0) {
expr=expr.substring(0,i)+b+expr.substring(i+a.length);
i+=b.length;
}
}
return expr
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment