我需要从一个URL。减去一个特定的参数(urlReturn)是这样的:。减去特定参数
http://somedomain.mx/th=6048000&campus=A&matric=L01425785&serv=GRAD&count=2&per=TEST&passwd=69786e720c0f0e&mount=1000.00&urlReturn=http://somedomain.mx:7003/SP/app/login.xhtml?id=1234&mat=2323&fh=05012014124755&store=TESO
我最终的字符串应该是这样的:
String urlReturn = http://somedomain.mx:7003/SP/app/login.xhtml?id=1234&mat=2323;
而其余的字符串应该看起来像这样:
String urlReturn2 = http://somedomain.mx/th=6048000&campus=A&matric=L01425785&serv=GRAD&count=2&per=TEST&passwd=69786e720c0f0e&mount=1000.00&fh=05012014124755&store=TESO
目前,我有这样的:
String string = string.toString().split("\\&")[0];
但urlReturn参数应该总是作为第一个。
你做了什么? –
告诉我们你做了什么。它需要一个子字符串和一对indexof来获得你想要的。 – elbuild