Replace special character in javascript
Hi Friends,I have following string getting inmy javascrpt file.
"t\'t"
I want to replace the \' with ' as opuput like below
"t't"
How to achiveve with javascript ???
Thx in advance..
<script language="JavaScript">
var tmp = new String('This is sample te!!!!st st>ring... So??? What...');
document.write(tmp + '<br>');
tmp = tmp.replace(/[^a-zA-Z 0-9]+/g,'');
document.write(tmp + '<br>');
</script>
str = str.replace(new RegExp('[^a-z0-9'+rep+']',"g"), '')
.replace(/-+/g, rep);
return str;
}