I am trying to run a test that will examine a selected file for illegal characters. It needs to test each read line before it fails or completes. I have this:
in this line of code
I need it to search lines[i] for every declared char in the illegal array.
Thanks for our help with this.
Code:
string[] lines = File.ReadAllLines(@newobject.csvDirectory);
string[] illegal = { "/", "*", "\\", "|",
":", "\"", "?", "<", ">" };
// Return an error for file with illegal characters
for (int i = 0; i < lines.Length; i++)
{
if (lines[i].Contains(illegal[]))
{
newobject.illegalError();
}
Code:
if (lines[i].Contains(illegal[]))
Thanks for our help with this.
Comment