日期:2014-05-20 浏览次数:20691 次
String name = "D:\\wy\\音频\\邓丽君-北国之春.mp3"; name = name.substring(name.lastIndexOf("\\") + 1, name.length()); Pattern p = Pattern.compile("(.+)-{1}(.+).mp3{1}"); Matcher m = p.matcher(name); while(m.find()){ System.out.println("歌手:" + m.group(1) + ";歌曲: " + m.group(2)); }
------解决方案--------------------