如何检测中的字符串(例如零宽度空间)在调试过程中隐藏人物 [英] How to detect hidden characters in string (for example zero width space) during debugging

查看:87
本文介绍了如何检测中的字符串(例如零宽度空间)在调试过程中隐藏人物的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有简单的方法如何检测(在调试期间),该字符串包含一些隐藏的字符(例如零宽度空间)

Is there any easy way how to detect (during debugging), that string contains some hidden character (for example zero width space)?

?例如:在调试过程中我M比较两个字符串目前存在的,他们似乎等于我的眼睛。当然,他们中一些隐藏charaters不同。如何找到有什么区别?

Example: During debugging I'm comparing two differnet strings and they seem equal to my eyes. Of course they differ in some hidden charaters. How to find the difference?

我用string.ToCharArray()在Visual Studio中的立即窗口的方法,但必须有更舒适的方式。

I used string.ToCharArray() method in "Immediate window" of Visual Studio but there must be more comfortable way.

推荐答案

如何:

text.Contains("\u200B")

text.IndexOf('\u200B') != -1

这篇关于如何检测中的字符串(例如零宽度空间)在调试过程中隐藏人物的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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