java以分号为分割符拼接字符串的技巧
String item = "E:\MR\CE\MDR\Technical Collection\88000099-Q Techinical File Index.pdf*/BC802DDC6A5349a4B1BB844292A70A78.pdf*1670891842|E:\MR\Technical Collection\\MTBF board.pdf*/A7666E3FCD244925954CA2AA0E9480E8.pdf*1890814742|"; String[] fileNames = item.getFileName().split("\\*/"); if(fileNames != null && fileNames.length>0){ StringBuffer newFileName = new StringBuffer(); for (int i=0;i<fileNames.length-1;i++) { String[] filename = fileNames[i].split("\\\\"); newFileName.append(filename[filename.length-1]).append(";"); } String fileNameStr = newFileName.deleteCharAt(newFileName.length() - 1).toString(); item.setFileName(fileNameStr); }
每天学习一点点,你就进步一点点。