I’ve got a number of paths like in memory (contained in an ArrayList):
C:\Program Files\Product\file.xml
What I want to do is remove the ‘C:\Program Files\’ from the path, so that just ‘Product\file.xml’. I know I could do this simply by replacing the ‘C:\Program Files\’ with ”, but the problem comes when I have paths from a localized environment, e.g. German where the path becomes:
C:\Programme\Product\file.xml
Any suggestions on how to do this?
In plain English, I want to remove everything before and including the second ‘\’.
Thanks.
If you want to take everything after the second backslash, use this:
If all you want to do is take everything after the second-to-last backslash, use this: