I know this has been asked before, but my code isn't working.
The senario is I need to check if a string ONLY contains letters, numbers and spaces. I need to fail if it contains any thing else.
I've tried the RegEx method, but I don't understand regular expressions, so I need to use a LINQ method for my assessment.
Here is my code:
if (!CSVItemArray[count].All(Char.IsLetterOrDigit) && !CSVItemArray[count].Contains(" "))
{
return false;
}