📜  c# null 检查 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:40.505000             🧑  作者: Mango

代码示例6
public static int CountNumberOfSInName(string name)
{
  if (name == null)
  {
    throw new ArgumentNullException(nameof(name));
  }

  return name.Count(c => char.ToLower(c).Equals('s'));
}