| ylbtech-Code-Func:传递的字符串中数字字符的数目 |
| 1.返回顶部 |
1、
using System; namespace Functions { public class DigitCount { // NumberOfDigits 静态方法计算 // 传递的字符串中数字字符的数目: public static int NumberOfDigits(string theString) { int count = 0; for ( int i = 0; i < theString.Length; i++ ) { if ( Char.IsDigit(theString[i]) ) { count++; } } return count; } } }
2、
| 2.返回顶部 |
| 3.返回顶部 |
| 4.返回顶部 |
| 5.返回顶部 |
| 6.返回顶部 |
| 作者:ylbtech 出处:http://ylbtech.cnblogs.com/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 |