去除数组中的空值

/**
     * 去除数组中的空值
     */
    public static String[] removeNullByArray(String strs) {
        String[] sysName = strs.split("\\|");
        List<String> tmp = new ArrayList<String>();
        for (String str : sysName) {
            if (str != null && str.length() != 0) {
                tmp.add(str);
            }
        }
        return tmp.toArray(new String[0]);
    }
发布了34 篇原创文章 · 获赞 3 · 访问量 3389

猜你喜欢

转载自blog.csdn.net/cold_long/article/details/104539725