Java字符串替换无法正常工作String delimiter = "\\*\\*";String html = "<html><head></head><body>**USERNAME** AND **PASSWORD**</body></html>";Map<String, String> mp = new HashMap<String, String>();mp.put("USERNAME", "User A");mp.put("PASSWORD", "B");for (Entry<String, String> entry : mp.entrySet()) { html.replace(delimiter + entry.getKey()+ delimiter, entry.getValue());}这应该通常取代这两个字符串,但事实并非如此。有没有人有想法?
添加回答
举报
0/150
提交
取消