String url="http://localhost:8084/blog1_1/title?uname=55%22";String onlyUrl=url.substring(0,url.lastIndexOf("?")); //this has the URL
String url="http://localhost:8084/blog1_1/title?uname=55%22";String onlyUrl=url.substring(0,url.lastIndexOf("?")); //this has the URL