使用Windows窗体c#在URL中计算特殊字符 [英] special characters count in a url using windows form c#
本文介绍了使用Windows窗体c#在URL中计算特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用windows表单在网址中计算特殊字符c#
special characters count in a url using windows form c#
推荐答案
尝试
http://weblogs.asp.net/psteele/pages/7509.aspx [ ^ ]
http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/a08a2595-b25f-4736 -86c4-15680ffa2d5f / [ ^ ]
string str = "hello@123:*&^789'!@#
*()_ + =跨度>;
int count = 0 ;
foreach ( char c in str)
{
if (!char.IsLetterOrDigit(c.ToString(), 0 ))
{
count ++;
}
}
MessageBox.Show(count.ToString());
*()_+="; int count = 0; foreach (char c in str) { if (!char.IsLetterOrDigit(c.ToString(),0)) { count++; } } MessageBox.Show(count.ToString());
这篇关于使用Windows窗体c#在URL中计算特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文