gpt4 book ai didi

Java 字符串替换不起作用

转载 作者:太空狗 更新时间:2023-10-29 22:41:59 24 4
gpt4 key购买 nike

<分区>

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());
}

这通常应该替换这两个字符串,但事实并非如此。有人有想法吗?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com