Skip to content

Instantly share code, notes, and snippets.

@kas-cor
Forked from CrowderSoup/find_replace.js
Created March 18, 2016 08:19
Show Gist options
  • Save kas-cor/ac60e05207b6408cdb96 to your computer and use it in GitHub Desktop.
Save kas-cor/ac60e05207b6408cdb96 to your computer and use it in GitHub Desktop.
Replace all instances of a substring without Regex in JavaScript
var str = 'This is a test string.';
// Let's replace all spaces with ','
str = str.split(' ').join(',');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment