Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

replace ’ with javascript (not ' )

i'm having a problem replacing ==> (apostrophe) with a space i know it looks so easy but what i mean is editors don't type apostrophe like this ==> but like this ==> ' and i can't find a way to replace it using

var newtext = old.replace(/'/g,"");

here's an example http://jsfiddle.net/zYK9f/4/ in this example you can type ==> in the page but not in the code editor tried a lot but no result hope you can help thanks sorry i mean apostrophe not semicolon

like image 265
jq beginner Avatar asked Feb 13 '12 19:02

jq beginner


1 Answers

Just copy and paste the character to account for both:

var newtext = old.replace(/'|’/g,"");
like image 142
Wayne Avatar answered Oct 28 '22 22:10

Wayne