📅  最后修改于: 2022-03-11 14:48:40.505000             🧑  作者: Mango
public static int CountNumberOfSInName(string name)
{
if (name == null)
{
throw new ArgumentNullException(nameof(name));
}
return name.Count(c => char.ToLower(c).Equals('s'));
}