我有一个数组变量
filesFound
,它保存了一个文件名。如何删除最后的数字部分和其扩展名呢?...
File[] filesFound = SomeUtils.findFile("xyz","c:\\")
//fileFound[0] is now "abc_xyz_pqr_27062016.csv"
//What I need is "abc_xyz_pqr" only
String[] t = filesFound[0].toString().split("_")
Arrays.copyOf(t, t.length - 1) //this is not working
...