正则替换开头和结尾的字符串 /** * remove redundant ' > ' * @param map map */ private void removeJoiner(Map<String, String> map) { for (Entry<String, String> entry : map.entrySet()) { entry.setValue(entry.getValue().replaceAll("(^ > )|( > &)","")); } } 效果如图