Click here to Skip to main content
15,919,422 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to globally replace a string @*$ with " using Javascript.

Please help..

Thanks
Posted

Use JavaScript String replace() Method[^]
e.g.
C#
var str = "hello, w@*$rld@*$dfd";
var res = str.replace(/@\*\$/g, "''");
 
Share this answer
 
v3
Comments
rupai99 11-Feb-15 4:01am    
Thanks buddy.
Peter Leow 11-Feb-15 4:55am    
You are welcome.
try..
Replacing all occurrences of a string in JavaScript
C#
var find = 'abc';
var re = new RegExp(find, 'g');

str = str.replace(re, '');

ref.
http://stackoverflow.com/questions/1144783/replacing-all-occurrences-of-a-string-in-javascript[^]
 
Share this answer
 
Comments
/\jmot 11-Feb-15 4:01am    
use Improve Question link to post your code.which's not working.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900