title: Remove a Column from a 2D Array
body: <p>I have little problem with removing col from a 2d array.</p>
  <p>The goal is to remove from every row specific index <code>&quot;2&quot;</code> and give it back.</p>
  <p><a href="https://i.stack.imgur.com/FoDB4.png" rel="nofollow noreferrer">Its how it need to be</a></p>
  <p>I made it but got little problem with <code>0</code> at the end.</p>
  <p><a href="https://i.stack.imgur.com/VGRWh.png" rel="nofollow noreferrer">Its how I got</a></p>
  <pre><code>private static void removeEntry(int[][] workArray, int col) {
      int row = workArray.length;
      //largest row count
      int max = 0;
      int tempNum = 0;
      for (int[] ints : workArray) {
          tempNum = 0;
          for (int j = 0; j &lt; ints.length; j++) {
              tempNum++;
              if (tempNum &gt; max) {
                  max = tempNum;
              }
          }
      }
      int [][] newArray = new int[row][max];
      for(int i = 0; i &lt; row; i++) {
          for(int j = 0; j &lt; max; j++) {
              if(j &lt; col &amp;&amp; j &lt; workArray[i].length) {
                  newArray[i][j] = workArray[i][j];
              }else if (j == col) {
                  // Do nothing
              } else if (j &gt; col &amp;&amp; j &lt; workArray[i].length) {
                  newArray[i][j - 1] = workArray[i][j];
              }
          }
      }
      for (int i = 0; i &lt; workArray.length; i++) {
          for (int j = 0; j &lt; workArray[i].length; j++) {
              workArray[i][j] = newArray[i][j];
          }
      }
      
  </code></pre>
  <p>Then I tried to remove <code>0</code> but don't work</p>
  <pre><code>int remIndex = 0;
      for (int i = 0; i &lt; workArray.length; i++) {
          for (int j = remIndex; j &lt; workArray[i].length-1; j++) {
              if(workArray[i][j] == remIndex){
                  workArray[i][j] = workArray[i][j + 1];
              }
          }
      }
  </code></pre>