title: remove last folder from path in nodejs with trailing and no trailng /
body: <p>Suppose I have a path</p>
  <pre><code>C:/Oracle/ or C:/Oracle
  </code></pre>
  <p>How can I remove the last folder and get the result as</p>
  <pre><code>c:/
  </code></pre>