I am kinda new to regex, I have a string e.g
String test = @"c:\test\testing";
Now what I would like to accomplish is to removing all words up to “\”. So in this case the work being removed is “testing”. Howerver, this word may be different everytime.
So bascally remove everyting until the first \ is found.
Any ideas?
You mean remove backwards, until the first \ is found?
You could easily do this without regexes:
But if you’re really just trying to get the directory component of a path, you can use this:
Although IIRC that method call will strip the trailing backslash.