title: Given full path, check if path is subdirectory of some other path, or otherwise
body: <p>I have 2 strings - dir1 and dir2, and I need to check if one is sub-directory for other. I tried to go with Contains method:</p>
  
  <pre><code>dir1.contains(dir2);
  </code></pre>
  
  <p>but that also returns true, if directories have similar names, for example - <strong><code>c:\abc</code></strong> and <strong><code>c:\abc1</code></strong> are not sub-directories, bet returns true. There must be a better way.</p>