2014-01-02

Javascript - String global replacements

var value = "asdf asdf";
value = value.replace(/a/g,"@"); 
console.log('value: [' + value + ']' );



This statement would only replace the first instance found:
value = value.replace("a", "@");

No comments:

Post a Comment