Using Regex I need to remove the last folder from a path:
Example : C:\Temp\Dir1\
Output : C:\Temp\
Please don’t suggest that I can do this with c# or other programming language. I really do need the regex for this.
Thanks in advance for the help.
Replace
by nothing. This works for paths like
C:\Temp\Dir1(no trailing backslash) as well. It fails for the root directory of a drive.