title: Remove Alternate Elements from ArrayList in java 7
body: <p>I have an array of String containing below elements</p>
  <pre><code>5.0,99,5.5,100,6.0,101
  </code></pre>
  <p>Now what I want to do I need to remove all the decimal value in string format like <code>5.0,5.5</code> and <code>6.0</code></p>
  <p>so my final array should contain elements <code>99,100,101</code></p>
  <p>so what I'd done so far is show in below code</p>
  <pre><code>public static String[] deleteElement(String[] str_array) {
          //String[] str_array = {&quot;item1&quot;,&quot;item2&quot;,&quot;item3&quot;};
          List&lt;String&gt; list = new ArrayList&lt;String&gt;(Arrays.asList(str_array));
          
          list.remove(&quot;5.0&quot;);
          list.remove(&quot;5.5&quot;);
          list.remove(&quot;6.0&quot;);
          return str_array = list.toArray(new String[0]);
      }
  </code></pre>
  <p>I have hardcoded the values which is quite bad practice as the values in future may be more than the current values, so I want a way to remove by using <code>index</code>.</p>
  <p>I have tried to remove using <code>remove(index)</code> also, using even index positioning like 0,2,4,but what actually happening is, after deletion of <code>5.0</code> , elements are shifted left side, so 100 comes into the 2nd position, and in next iteration 100 deleted.</p>
  <p>So is there any way where I can construct a generic function so if there are more elements in decimal value so it can also be deleted.</p>
  <p><strong>NOTE</strong>:
  The string decimal values will always be residing on even index positioning.</p>