字符串包含隐藏字符,无法验证, [英] String has hidden characters, Can't able to verify ,

查看:151
本文介绍了字符串包含隐藏字符,无法验证,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在2个小时前问了一个问题

I asked a question some 2 hours before

[不需要看到这个问题,只是一个参考]
< a href = https://stackoverflow.com/questions/38099262/storing-images-using-node-js-gives-error>使用node.js存储图像会出错

给出的解决方案实际上与我的代码相同,我试图找出我的代码与他的代码之间的区别,以查看他对其进行了哪些修改以使其起作用,但是没有任何修改。

The solution given was was literally the same of my code, I tried to find the difference between my code and his code to see what's the modification he did to make it work, But there is nothing modified.

因此,我想到了在线IDE进行尝试,并尝试了c9.io在线IDE进行检查。但是突然间,在线c9.io IDE中出现了一些奇怪的东西,我的本地崇高编辑器没有显示出来。

So i thought of trying it online IDE and i tried c9.io online IDE to check it. But suddenly something showed up little bit strange in the online c9.io IDE which my local sublime editor did't show it.

下图是文本我看到了崇高的境界,没有任何
差异。

The below image is text which i saw in sublime, Which does't have any difference.

-

以下是我在c9.io中找到的文本。如您所见,在c9.io javascript编辑器中新显示了两个点

The below is the text i found in c9.io . As you can see clearly there is two dots showed up newly in c9.io javascript editor.


我看不到普通文本编辑器的区别,然后在线
不同的检查器也显示了错误。

I could not able to see the difference that in normal text editor, Then in online different checker also showed the error.

以下是两个字符串之间具有隐藏差异的文本

AybükeArslan‌​_(3).JPG

AybükeArslan_(3).JPG




只需将上面的文本粘贴到 https://www.di ffchecker.com/ 之后,您会看到上面的
两个字符串之间的区别

Just copy paste the above text in https://www.diffchecker.com/ after then you could see the difference between the above two strings

谁能告诉这是什么原因,以及如何通过JavaScript函数从字符串中删除不需要的字符。在我的服务器上,五个小时来一直困扰着人们。

Can anyone tell what's the reason for this and how to remove the unwanted characters from the string through a javascript function. It's been giving one hell of a problem for 5 hours in my server.

推荐答案

<$ c之间有2个Unicode字符$ c> n 和 _ ,一个 ‌零宽度非连接符,后跟一个零宽度空间

There are 2 Unicode characters between the n and the _, a ‌ zero width non-joiner followed by a zero width space.

看到它们取决于您使用的编辑器/字体以及它决定显示此类不可打印字符的方式(如果有的话)。

Seeing them will depend on the editor/font you use and how it decides to display this class of non-printable character - if at all.

要删除它们:

newStr = oldStr.replace(/[\u200c\u200b]/g, "");

这篇关于字符串包含隐藏字符,无法验证,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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