If i have:
C:\\temp\\foo\\bar\\
(NOTE: bar is a directory)
how can i parse out:
bar
if the answers above do not satisfy your needs, why not just substring the string from the last .
string dirName = originalDirName.Substring(originalDirName.LastIndexOf("\\") + 1);
sure, you should do some checking if the originalDirName does not end on a \ and if the originalDirName is longer than zero and actually contains \ characters.