I want to remove last three character of filenames. To rename any files, i'm using:
String str = ""; // Here set File name, i.e. listFile.getName();
String[] tempFile = str.split("[$^txt]");
This regex remove last three character it's OK, but when passing any file name containing "t OR x" the regex remove it. For example:
1) fileName.txt -> result after split -> fileName -> OK.
2) textfile.txt -> result after split -> efile. -> remove any t OR x in file name.
My Q is : How i can remove only last three char.
Thank you