private String[] removeArrayEmptyTextBackNewArray(String[] strArray) {
List<String> strList= Arrays.asList(strArray);
List<String> strListNew=new ArrayList<>();
for (int i = 0; i <strList.size(); i++) {
if (strList.get(i)!=null&&!strList.get(i).equals("")){
strListNew.add(strList.get(i));
}
}
String[] strNewArray = strListNew.toArray(new String[strListNew.size()]);
return strNewArray;
}
Java 去除数组空元素
最新推荐文章于 2024-07-11 14:18:10 发布