static int GetUniqueCharCountWithInBuiltFunc(string inputString)
{
if (string.IsNullOrEmpty(inputString))
{
throw new NullReferenceException();
}
char[] inputArray = inputString.Replace(" ", "").ToCharArray();
return inputArray.Distinct().Count();
}
No comments:
Post a Comment