Given a block of string like:
var copy = "Hello world what is the day @James Bond blah bah blah blah...";
Using jQuery/JS, given:
var term = "James Bond";
var id = "XXXXXX";
How can I find all matches with '@' + term and return the something like this:
"Hello world what is the day @[XXXXXX:James Bond] blah bah blah blah..."
Thanks
Just use replace function: