mirror of
https://bitbucket.org/Mattrixwv/csclasses.git
synced 2025-12-06 18:23:58 -05:00
Added FindNumOccurrence()
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user