String split() not working correctly
<pre><code>temp = line.split(",");
if (i &lt; paymentFieldsMapIndex.size()) {
    paymentFields.put(paymentFieldsMap.get(next).toString(), temp[i]);
}
</code></pre>

<p>This code splits up a comma delimited string into substrings and populates a HashMap value using the resulting substrings.</p>

<p>Some substring values look funny in the resulting HashMap, looks like it's due to the presence of commas in the token.</p>

<p>For instance</p>

<p>,"LONDON,UNITED KINGDOM",</p>

<p>in the string appears in the HashMap like</p>

<p>Key = key, Value = "LONDON</p>

<p>I thought that String split(), will not break up substrings containing the delimiter if they are enclosed in double quotes?</p>

<p>I've also tried escaping the embedded comma like</p>

<p>,"LONDON\,UNITED KINGDOM",</p>

<p>but the string in the HashMap looks like</p>

<p>Key = key, Value = "LONDON\</p>

<p>Am I missing something, or is there any way around this problem?  Thanks.</p>
