No, don't split anything and don't use direct string manipulations as other advised.
Instead, first extract the directory using
System.IO.Path.GetDirectoryName
; see:
http://msdn.microsoft.com/en-us/library/system.io.path.getdirectoryname.aspx[
^].
On the result, use the method
System.IO.Directory.GetParent
required number of times, see:
http://msdn.microsoft.com/en-us/library/system.io.directory.getparent.aspx[
^].
Unlike direct string manipulations where you can easily make a mistake, these methods are reliable and platform independent.
—SA