Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

replacing characters in string javascript

var myStr = 'this,is,a,test';
var newStr = myStr.replace(/,/g, '-');

console.log( newStr );  // "this-is-a-test"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #replacing #characters #string #javascript
ADD COMMENT
Topic
Name
8+9 =