Question: Is there a simpler way, other than String matching, to parse the below string? :

```
com.atlassian.greenhopper.service.sprint.Sprint@719c9e23
    [name=Sprint 1,
     closed=true,
     startDate=2013-04-10T17:58:49.228-07:00,
     endDate=2013-04-24T17:58:49.228-07:00,
     completeDate=2013-04-16T14:42:09.504-07:00,id=10]

```

I am interested in getting the `name`,`closed` and other such values.

(This string is an element of a JSONArray, type `org.codehaus.jettison.json.JSONArray`, that I'm getting from JIRA.)

Answer: 
This is the way I did it, that is readable and does not involve regex.

```
String keyValue = str.substring(str.indexOf("[") + 1, str.lastIndexOf("]"));
StringTokenizer tok = new StringTokenizer(keyValue, ",");
Map<String, String> map = new LinkedHashMap<String, String>();
while (tok.hasMoreTokens()) {
    String entString = tok.nextToken();
    map.put(entString.split("=")[0], entString.split("=")[1]);
}

```

From this point, I get values I need by doing

```
map.get("name")

```
Where do you get this String from? This output does look very much like a `toString()` implementation. Do you have a reference to this JSONArray object? If so:

The [API](http://jettison.codehaus.org/apidocs/org/codehaus/jettison/json/JSONArray.html) says that the object provides methods such as `getString(int index)`.

Therefore `sprintObject.getString(0)` should return `Sprint 1`