作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个
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/
我是一名优秀的程序员,十分优秀!