System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex("[\u4e00-\u9fa5]", System.Text.RegularExpressions.RegexOptions.Multiline); string strTemp = "随机产生了了多2333afadsg不筱个af575这样的了的算法"; MessageBox.Show(reg.Matches(strTemp).Count.ToString());
使用正则表达式计算字符串中中文字符的个数
最新推荐文章于 2020-04-01 20:44:47 发布