I have URL string like:
"http://www.xyz/path1/path2/path3?param1=value1¶m2=value2".
I need to get this url without parameters, so the result should be:
"http://www.xyz/path1/path2/path3".
I have done it this way:
private String getUrlWithoutParameters(String url)
{
return url.substring(0,url.lastIndexOf('?'));
}
Are there any better ways to do it?