Replacing double quotes with replace function

Posted by Sekhar141 under JavaScript on 5/18/2010 | Views : 6340 | Status : [Member] | Replies : 1
I want to replace the Double quotes in a string( " ) with " with replace function :

But it is not working :

sample code :

txt="Testing the "Data" in the document";
txt.replace(' \" ','&quote');


But it not working.

Please tell me if anybody know it need it very urgently........


Thanks in advance..

sekhar.




Responses

Posted by: Sipra on: 5/19/2010 [Member] Starter

Up
0
Down
Please see below codes.
<script type="text/javascript" language="javascript">
function Test()
{
var text = "Testing the \"Data\" in the document";
var x = text.replace("\"","&quote;");
//alert(x);
}
</script>

Hope this helps.

Sipra

Sekhar141, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response