using System.Linq;publicclassKata{publicstaticintLowercaseCountCheck(string s){return s.Count(char.IsLower);}}
答案2:
using System.Text.RegularExpressions;publicclassKata{publicstaticintLowercaseCountCheck(string s){// your code goes here ...return Regex.Matches(s,"[a-z]").Count;}}
答案3:
using System.Text.RegularExpressions;publicclassKata{publicstaticintLowercaseCountCheck(string s){return Regex.Matches(s,"[a-z]").Count;}}
答案4:
using System.Text.RegularExpressions;publicclassKata{publicstaticintLowercaseCountCheck(string s){return Regex.Matches(s,@"[a-z]").Count;}}
答案5:
using System.Text.RegularExpressions;publicclassKata{publicstaticintLowercaseCountCheck(string s){return Regex.Matches(s,@"([a-z])").Count;}}
答案6:
using System;using System.Linq;publicclassKata{publicstaticintLowercaseCountCheck(string s)=> s.ToCharArray().Where(x => Char.IsLower(x)).Count();}
答案7:
using System;publicclassKata{publicstaticintLowercaseCountCheck(string s){var result ="";foreach(var val in s){if(char.IsLower(val)){
result += val;}}return result.Length;}}
答案8:
using System.Linq;publicclassKata{publicstaticintLowercaseCountCheck(string s)=> s.Count(c =>char.IsLower(c));}
答案9:
using System.Collections.Generic;using System.Linq;publicclassKata{publicstaticintLowercaseCountCheck(string s)=>(newList<char>(s)).Count(c =>char.IsLower(c));}
答案10:
using System.Text.RegularExpressions;publicclassKata{publicstaticintLowercaseCountCheck(string s){// your code goes here ...Regex regex =newRegex(@"([a-z])");return regex.Matches(s).Count;}}
答案11:
publicclassKata{publicstaticintLowercaseCountCheck(string s){int c =0;for(int i =0; i < s.Length; i++){if(s[i]>='a'&& s[i]<='z'){
c++;}}return c;}}
答案12:
using System.Text.RegularExpressions;publicclassKata{publicstaticintLowercaseCountCheck(string Input){returnnewRegex("[^a-z]").Replace(Input,"").Length;}}