|
if (re.startsWith("Author")) {
// 需要修改
// 把多个author放在??中?怎样计算“Author”出现次数?
StringBuffer au = new StringBuffer();
String author = au.append(input.substring(input.indexOf("-") + 2)).toString();
System.out.println(author); //输出:多个作者名,每个名字占一行
GlobalMode.put("author", author); //只输出最后一个作者名
注:之前定义的: HashMap<String, String> GlobalMode = new HashMap<String, String>();
请问:author应该是字符串吧,可是为什么GlobalMode.put("author", author);时只输出最后一个作者名呢?不解.. |
|