Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# null check

public static int CountNumberOfSInName(string name)
{
  if (name == null)
  {
    throw new ArgumentNullException(nameof(name));
  }

  return name.Count(c => char.ToLower(c).Equals('s'));
}
Source by www.thomasclaudiushuber.com #
 
PREVIOUS NEXT
Tagged: #null #check
ADD COMMENT
Topic
Name
2+5 =