Originally posted by Bob Good: batchId=10 contains the string batchId=1 You could test for batchId=10 first Or perhaps use a StringTokenizer class. [ March 07, 2008: Message edited by: Bob Good ]
Originally posted by Rob Prime: String.split should suffice: String params = myString.split("&");
for (String s: params)
String keyval = s.split("=");
if (keyval.equals("batchID") && keyval.length > 1)
// found a batchId element
} This even allows you to create a Map out of all options, although you must keep in mind that a single key can occur multiple times in these kinds of request parameters.