private String [ ] normalize ( String [ ] list , int minlength ) { if ( list . length < minlength ) { // Need to do padding String [ ] newlist = new String [ minlength ] ; System . arraycopy ( list , 0 , newlist , 0 , list . length ) ; Arrays . fill ( newlist , list . length , newlist . length , "0" ) ; return newlist ; } else { return list ; } }
Normalize an array to a certain length