Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove following symbol/special character in string using jquery ¶

How to remove following symbol/special character in string using jquery

I have problem during comparing two strings . Above mentioned symbol is append when I compute difference. I also test it in my local application please check link below.

http://neil.fraser.name/software/diff_match_patch/svn/trunk/demos/demo_diff.html

like image 386
Ali Avatar asked Jan 30 '26 22:01

Ali


1 Answers

var s = "This is a string that contains ¶, a special character.";
s = s.replace(/¶/g, "");

Yields:

"This is a string that contains , a special character."

This will remove all occurrences of the character. No jQuery necessary - just vanilla browser-provided JavaScript.

Some additional details are available at https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/replace.

like image 162
ziesemer Avatar answered Feb 02 '26 13:02

ziesemer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!