菜鸟求助,代码简化一下
下面的三个判断能不能用for循环简化一下
if (from1.getuploadfile1().getFileSize() != 0) {
System.out.println("1234");
str = com.getpicturename(from1.getuploadfile1(), path);
strpath.append(str + ",");
}
if (from1.getuploadfile2().getFileSize() != 0) {
System.out.println("1234");
str = com.getpicturename(from1.getuploadfile2(), path);
strpath.append(str + ",");
}
if (from1.getuploadfile3().getFileSize() != 0) {
System.out.println("1234");
str = com.getpicturename(from1.getuploadfile3(), path);
strpath.append(str + ",");
}