且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ylbtech-Unitity-cs:传递的字符串中数字字符的数目

更新时间:2022-08-15 13:41:17

ylbtech-Unitity-cs:传递的字符串中数字字符的数目

 

1.A,效果图返回顶部
 
1.B,源代码返回顶部
1.B.1,
ylbtech-Unitity-cs:传递的字符串中数字字符的数目
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;
        }
    }
}
ylbtech-Unitity-cs:传递的字符串中数字字符的数目
1.B.5,
1.C,下载地址返回顶部

本文转自ylbtech博客园博客,原文链接:http://www.cnblogs.com/ylbtech/p/5062031.html,如需转载请自行联系原作者