Do I use a regular expression on this file path?
<p>I have to strip a file path and get the parent folder.</p>

<p>Say my path is </p>

<pre><code>\\ServerA\FolderA\FolderB\File.jpg
</code></pre>

<p>I need to get</p>

<ol>
<li><p>File Name = File.jog</p></li>
<li><p>Folder it resides in = FolderB</p></li>
<li><p>And parent folder = FolderA</p></li>
</ol>

<p>I always have to go 2 levels up from where the file resides.</p>

<p>Is there an easier way or is a regular expression the way to go?</p>
