title: c# Check if a file path contains a specific directory
body: <p>When I get a path like c:\folder1\a12\somefile.txt, I want to check if the file name contains a directory c:\folder1\a1. </p>
  
  <p>The above file name should return false.</p>
  
  <p>The code does not have access to the file system in question. It does not need to check the existence of the file or the folder. Just need to follow the file and directory name convention.</p>
  
  <p>It would be nice if the code could handle alternate path separator/UNIX paths. </p>