code: public static String[] trimStringArray(final String[] input) {
          final ArrayList<String> output = new ArrayList<String>();
          for (int i = 0; i < input.length; i++) {
              String s = input[i].trim();
              if (!s.equals("")) output.add(s);
          }
          return output.toArray(new String[0]);
      }
docs: Trims an array of Strings to remove the whitespace. If the string is empty then its removed from the array.
  
  @param input The array of strings to be trimmed
  @return The same array of strings but all elements have been trimmed of whitespace