Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get parameter from a parameter...

Status
Not open for further replies.

Pichdude

Programmer
Aug 24, 2005
66
SE
Hi,

Is there anyone who can help me with the following problem? I want to collect a value on a parameter that is being posted from a website.

The parameter looks like this on the webpage (Base64 encoded):
Parameter="VEFSR0VUPXdlYi5qc3AmVkFMVUU9MTIzNDU2Nzg5"

I collect the whole parameter in a common way in my java class, request.getParameter("Parameter"), and Base64 decodes it and saves it to a string. The string now contains: TARGET=web.jsp&VALUE=123456789

Now to the problem, I only want to collect the value in the string that is after VALUE= (i.e. 123456789). Is that possible?

Best regards
 
Sure.

Code:
String myFirstParameter="TARGET=web.jsp&VALUE=123456789";
String myLastParameter = myFirstParameter.substring(myFirstParameter.lastIndexOf("=")+1);

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top