Do I use a regular expression on this file path?
Posted
by uno
on Stack Overflow
See other posts from Stack Overflow
or by uno
Published on 2010-04-20T19:09:32Z
Indexed on
2010/04/22
8:13 UTC
Read the original article
Hit count: 274
c#
I have to strip a file path and get the parent folder.
Say my path is
\\ServerA\FolderA\FolderB\File.jpg
I need to get
File Name = File.jog
Folder it resides in = FolderB
And parent folder = FolderA
I always have to go 2 levels up from where the file resides.
Is there an easier way or is a regular expression the way to go?
© Stack Overflow or respective owner