所以我有一个网址
String url = request.getRequestURL()+"?"+request.getQueryString();
有一个参数 Custom="true",我想在将其存储在 url 中之前将其删除。 有没有有效的方法来做到这一点,而不使用正则表达式。
Example -
http://myhost:8080/people?lastname=Fox&age=30&Custom=true&verified=yes
request.getQueryString(); // "lastname=Fox&age=30&Custom=true&verified=yes"
Desired o/p - lastname=Fox&age=30&verified=yes
最佳答案
只需将 Custom=true
替换为空字符串
query = query.replace("Custom=true&","");
关于java - 不使用正则表达式从查询字符串中删除一个参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55179996/