Windows窗体中的简单正则表达式 [英] Simple regular expression in windows form
本文介绍了Windows窗体中的简单正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
正则表达式可以检查空白的TextBox吗?
如果是,那么它的代码是什么?
我可以在网上搜索,但不太容易.
是否有任何用于检查TextBox为空的正则表达式代码?
在此先感谢
请帮忙.
Can regular expression examines blank TextBox?
If yes, then whats the code for it?
I have search on net but its not too easy.
Is there any Regex code for examining TextBox is blank?
Thanks in advance
Please help.
推荐答案
您不需要Reguar表达式,只需在这里使用String.IsNullOrWhiteSpace:
You don''t need Reguar expressions for that just use String.IsNullOrWhiteSpace as here:
String.IsNullOrWhiteSpace(textBox1.Text);
看到此链接:
http://msdn.microsoft.com/en-us/library/system.string. notullorwhitespace.aspx [ ^ ]
See this link:
http://msdn.microsoft.com/en-us/library/system.string.isnullorwhitespace.aspx[^]
这篇关于Windows窗体中的简单正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文