Dilip G Dilip G - 27 days ago 8
Javascript Question

how to remove this symbol ₹ from table

i have this ₹ symbol i want to remove it so that i can export my table with this symbol export is giving error

i'm trying something like this



$(document).ready(function(){
var table = $('#a').html();
table.replace("₹",'');
console.log(table);
});

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<div id="a">
<table id="table">

<tr>
<th>vcajasjhhjd</th>
<th>jdshbdfhfdh</th>
</tr>
<tr>
<td>abcd ₹ njdhjdrhjr</td>
<td>jdhjhjfhjghghg₹jdshdfhs₹</td>
</tr>

</table>

</div>




Answer

You need to remove the unicode character of Indian Rupee sign

str.replace(/[^\x00-\x7F]/g, "");

The above code removes all unicode characters in a string. It should work.

Or to remove only ruppees sign

str.replace("\u20b9",'');

should work