gpt4 book ai didi

双花括号的 Java 正则表达式模式

转载 作者:行者123 更新时间:2023-12-01 18:01:45 24 4
gpt4 key购买 nike

我有一个

String url = "/rest/devices/{{deviceId}}";

其中{{deviceId}}我想用一些 deviceId 替换的值。

url.replace("{{deviceId}}", device.getId());

但是它不起作用。

因此,该怎么办?

最佳答案

我猜你错过了作业和结果

url.replace("{{deviceId}}", device.getId()); 被忽略。

关于:

url = url.replace("{{deviceId}}", device.getId());

关于双花括号的 Java 正则表达式模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40389185/

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