日期:2014-05-20 浏览次数:20754 次
// 合并 --------------------------------------------------- StringBuilder strBuilder = new StringBuilder(fileName); strBuilder.append("/r/n"); strBuilder.append(subject); strBuilder.append("/r/n"); strBuilder.append(category); System.out.println(strBuilder.toString()); // 拆分 --------------------------------------------------- String[] strDest = strBuilder.toString().split("/r/n"); if(strDest.length != 3) System.err.println("error: strDest.length != 3"); // fileName System.out.println("fileName: " + strDest[0]); // subject System.out.println("subject: " + strDest[1]); // category System.out.println("category: " + strDest[2]);
------解决方案--------------------
str.split("/");