Here you can find the source of removeEmptyStrings(String[] tokens)
public static String[] removeEmptyStrings(String[] tokens)
//package com.java2s; import java.util.ArrayList; public class Main { public static String[] removeEmptyStrings(String[] tokens) { ArrayList<String> result = new ArrayList<>(); for (String token : tokens) if (!token.equals("")) result.add(token);//from www .ja v a 2s . c om String[] res = new String[result.size()]; result.toArray(res); return res; } }