title: Parse from List<String> Java
body: <p>I am attempting to parse the value of the elements in a List declared as thus: </p>
  
  <pre><code> List&lt;String&gt; uniqueList = new ArrayList&lt;String&gt;(dupMap.values());
  </code></pre>
  
  <p>The values are such as this:</p>
  
  <pre><code>a:1-2
  b:3-5
  </code></pre>
  
  <p>but I want one ArrayList with the first number (i.e. 1, 3) and another with the second (i.e. 2, 5). I have this worked out... Sorta:</p>
  
  <pre><code>String delims= "\t"; String delim2= ":"; String delim3= "-";
  String splits2[]; String splits3[]; String splits4[];
  Map&lt;String,String&gt; dupMap = new TreeMap&lt;String, String&gt;();
  List&lt;String&gt; uniqueList = new ArrayList&lt;String&gt;(dupMap.values());
  ArrayList&lt;String&gt; parsed2 = new ArrayList&lt;String&gt;();
  ArrayList&lt;String&gt; parsed3 = new ArrayList&lt;String&gt;();
  ArrayList&lt;String&gt; parsed3two= new ArrayList&lt;String&gt;();
  double uniques = uniqueList.size();
  for(int a=0;a&lt;uniques;a++){
      //this doesn't work like it would for an ArrayList
      splits2 = uniqueList.split(delim2) ;
      parsed2.add(splits2[1]);
      for(int q=0; q&lt;splits2.length; q++){
          String change2 = splits2[q];
          if(change2.length()&gt;2){
             splits3 = change2.split(delim3);
             parsed3.add(splits3[0]);
             String change3=splits3[q];
             if (change3.length()&gt;2){
                 splits4 = change3.split(delims);
                 parsed3two.add(splits4[0]);
             }
          }
       }
    }
  </code></pre>
  
  <p>uniqueList.split does not work however and I don't know if there is a similar function for List. Is there any suggestions? </p>