小编use*_*230的帖子

如何在字符串url中替换查询参数

你好,我有一个像url的字符串

http://example.com/foo/?bar=15&oof=myp
Run Code Online (Sandbox Code Playgroud)

现在假设我想将bar参数中的int值更改为16,以便拥有

http://example.com/foo/?bar=16&oof=myp
Run Code Online (Sandbox Code Playgroud)

我怎样才能做到这一点?考虑到=后面的数字可能是1,2或3个字符.谢谢

java string url

3
推荐指数
1
解决办法
4724
查看次数

标签 统计

java ×1

string ×1

url ×1