How to split Strings into int array in java
<p>Here i have this type of String and i want to split this string in to every elements and want to make one arraylist(integer) or one integer array for numbers.</p>

<p>I have String like this for a example : <code>123|00,124|01,125|00,126|01</code> </p>

<p>I want to first seprate all elements in one list which contains</p>

<pre><code>123|00
124|01
125|00
126|01
</code></pre>

<p>And after i want to make one integer array list or integer array which have only </p>

<pre><code>123
124
125
126
</code></pre>

<p>Please any body can suggest me how can i do this</p>

<p>Thanks</p>

<p>Code:</p>

<pre><code>            List&lt;Integer&gt; numberList = new ArrayList&lt;Integer&gt;();
        HashMap&lt;Integer, Integer&gt; statusMap = new HashMap&lt;Integer, Integer&gt;();
        for (String tripnumber : tripNumbers) {

            int number = Integer.parseInt(tripnumber.split("[|]")[0]);
            Logger.d(TAG, "Trip number in Status Message = "+number);

            int flag = Integer.parseInt(tripnumber.split("[|]")[1]);
            Logger.d(TAG, "TM flag = "+flag);

            if (number &gt; 0) {
                statusMap.put(number, flag);
                numberList.add(number);
            }
        }
</code></pre>
