I was wondering if there is any nice solution for the following problem:
Assuming I have a line with an absolute Path to the file, and the file has the prefix "temp_". I can crop the prefix using string.replaceFirst ().
But if I'm out of luck, "temp_" is also part of the directory on this line. How to make sure that only the last appearance will be cropped?
I can only think to take it apart myself, but was it interesting if there is magic to make it better?
To be more precise as an example:
C:\Dump\sol1\temp_results\temp_2012-04-core.pcap
It should become:
C:\Dump\sol1\temp_results\2012-04-core.pcap
source
share