title: How to tell if a path is an subset of a new path?
body: <p>I want to move an old folder with all its contents to another new folder, however, I've to check that the new folder destination is not including the old folder destination otherwise I am trying to move the folder into itself which is impossible.</p>
  
  <p>I want to check whether an old path already is a subset of a new path.</p>
  
  <p>Something like:</p>
  
  <pre><code>check_function( "folder/test" , "folder/test/test2"); //true
  check_function( "folder/test/" , "folder/test/test2"); //true
  
  check_function( "folder/test" , "folder/test2"); //false
  check_function( "folder/test" , "folder/test2/test3"); //false
  </code></pre>
  
  <p>How can I do this?</p>