Meh*_*san 0 java string url uri
当我运行我的项目时,我有一个 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
Run Code Online (Sandbox Code Playgroud)