http://www.yahoo.com &b=128&f=norefer
I want to remove &b=128&f=norefer
&b=128&f=norefer
String finalUrl =decodedUrl.repl
You can use the following regex replacement to remove everything after the first ampersand:
"http://www.yahoo.com &b=128&f=norefer".replaceAll("&.*$", "");