Problems reading text file data in Java
<p>I have this code:</p>

<pre><code>  BufferedReader br =new BufferedReader(new FileReader("userdetails.txt"));
     String str;
     ArrayList&lt;String&gt; stringList = new ArrayList&lt;String&gt;();
     while ((str=br.readLine())!=null){
        String datavalue [] = str.split(",");
        String category = datavalue[0];
        String value = datavalue[1];
        stringList.add(category);
        stringList.add(value);
     }
     br.close();
</code></pre>

<p>it works when the variables category and value do not have a comma(,),however the values in the variable value does contain commas.Is there a way that I can split the index of the without using comma?</p>
