I want to include a batch file rename functionality in my application. A user can type a destination filename pattern and (after replacing some wildcards in the pattern) I n
Simplifying the Eugene Katz's answer:
bool IsFileNameCorrect(string fileName){ return !fileName.Any(f=>Path.GetInvalidFileNameChars().Contains(f)) }
Or
bool IsFileNameCorrect(string fileName){ return fileName.All(f=>!Path.GetInvalidFileNameChars().Contains(f)) }