如何从JS字符串中删除↵字符 [英] How to remove ↵ character from JS string

查看:270
本文介绍了如何从JS字符串中删除↵字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个字符串

↵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.

推荐答案


工作正常。

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.

您还可以使用

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

这篇关于如何从JS字符串中删除↵字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆