I need only need the UserID= part . How do I do it. If it was in a map, I could do something like header.get("UserID"). But it wouldn't allow me to do that, how do I get round it. I need to pass the USerID somewhere in my code.
I don't think Kel's suggestion is appropriate here.
substring and indexOf() would be one way to do this; the newer String.split() method would be another. Splitting several times, using ',' and then '=' as separator, would let you break this into key, value pairs, and then into individual keys and values.
CSP-User-Info: AccountID=250387,Login%u0020Name=sampath,UserId=79 ========= 1. use String.split(",") split the String to a String array 2. then conversion the String array to a HashMap(key, value),(you need write a method by yourself.) 3. use HashMap's get(Object key) method get what you want value
4. then you can reuse this method in other class
Joined: Oct 06, 2007
Hello Guys, I was able to get the string and then I had to break it down using String tokenizer. The value I want at this time is the one stored in String f4 which is the value of the user ID.
I need this f4 in another part of my code , how do I get it.