ipankaj ipankaj - 1 month ago 31
Javascript Question

How to remove ↵ character from JS string

I have a string like

↵my name is Pankaj↵


I want to remove the
character from the string.

"↵select * from eici limit 10".replace("↵", "")


Works fine. But I want to know if there is any other way to remove these kind of unnecessary characters.

Answer

works fine.

If it works fine, then why bother? Your solution is totally acceptable.

but I want to know is there is any other way to remove these kind of unnecessary characters.

You could also use

"↵select * from eici limit 10".split("↵").join("")