I have URL like this:


I need to pass gagh362%%23atg._f46 part to a string. All the examples i find are for simple PHP parameter parsing and i'm having difficulties to adapt them to this case. Can someone help?

You can do this kind of thing using the indexOf and substring methods of the String class. So myUrlAsString.indexOf("secret_code=") gives the start point of that string, add 12 to get the index of the first char after it, which is where your target text is located. Use the same approach to find the end of your target (either the end of the URL string, or an "&" maybe?). Then use substring to pick out the text between those two indexes.

Thanks for help, James