diff --git a/CSClasses/Algorithms.cs b/CSClasses/Algorithms.cs index d7031c4..1747384 100644 --- a/CSClasses/Algorithms.cs +++ b/CSClasses/Algorithms.cs @@ -705,5 +705,9 @@ namespace mee{ //Return the proper number. The location counter is 1 off of the subscript return fibNums[(fibLoc - 1) % 3]; } + //This function return sht enumber of times the character occurs in the string + public static long FindNumOccurrence(string str, char c){ + return str.Count(ch => ch == c); + } } }