Added FindNumOccurrence()

This commit is contained in:
2020-10-03 12:42:19 -04:00
parent 2d7b85a7f5
commit f024426520

View File

@@ -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);
}
}
}