Skip to content

Instantly share code, notes, and snippets.

@priesdelly
Created February 24, 2019 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save priesdelly/4ea89bd02fdd28f60d847f06346a6fbd to your computer and use it in GitHub Desktop.
Save priesdelly/4ea89bd02fdd28f60d847f06346a6fbd to your computer and use it in GitHub Desktop.
Replace string in javascript
var strText = 'Test Replace bear and duck and dog and cat';
var strAfRep = strText.replace(/and/g,'or');
console.log(strAfRep);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment