I have a string with the UTF-8 character
. To my understanding, if you want to replace a UTF-8 character in a string, you specify the character with its hexadecimal representation, like so:
var string = "↵↵↵Middle↵↵↵";
console.log("Match? " + /\u21b5/.test("↵"));
string = string.replace("/\u21b5/g", "");
It is a match, but the replace is not working. What am I missing?