当运行项目时,有一个 URL。
http://localhost:8084/blog1_1/title?uname=55%22
从这个 URL 中删除查询字符串,如下所示:
http://localhost:8084/blog1_1/title
就可使用下面的字符串处理了
String url="http://localhost:8084/blog1_1/title?uname=55%22";
String onlyUrl=url.substring(0,url.lastIndexOf("?")); //this has the URL