public static char[] trim(final char[] array,final int length){
  if (length >= array.length)   return array;
  final char t[]=length == 0 ? EMPTY_ARRAY : new char[length];
  System.arraycopy(array,0,t,0,length);
  return t;
}

public static char [ ] trim ( final char [ ] array , final int length ) { if ( length >= array . length ) return array ; final char t [ ] = length == 0 ? EMPTY_ARRAY : new char [ length ] ; System . arraycopy ( array , 0 , t , 0 , length ) ; return t ; }
trims the given array to the given length .
