What is wrong here:
The line ' if (newName.Contains(x.ToString))' gives me this error 'Error 1 The best overloaded method match for 'string.Contains(string)' has some invalid arguments'Code:char[] InvalidsArray = Path.GetInvalidFileNameChars(); foreach (char x in InvalidsArray) { if (newName.Contains(x.ToString)) { return false; } } return true;
x is converted to a string, right? So what am I doing wrong?
Thanks!




Reply With Quote