1 回答
TA贡献1809条经验 获得超8个赞
您好,您需要两个句子,一个用于第一个数组,第二个用于与短数组列表进行比较,当您发现条件为真时,不要忘记打破循环,如下所示:
List<String> new_valueString = new ArrayList<>();
List<String> new_fieldsString = new ArrayList<>();
List<String> oldValueString = new ArrayList<>();
List<String> oldFieldsString = new ArrayList<>();
if (new_fieldsString.size() != 0 && new_valueString.size() != 0) {
for (int l = 0; l < new_fieldsString.size(); l++) {
for (int m = 0; m < oldFieldsString.size(); m++) {
if (new_fieldsString.get(l).equalsIgnoreCase(oldFieldsString.get(m))) {
if (!new_valueString.get(l).contains(oldValueString.get(m))) {
ifUpdated = true;
} else {
ifUpdated = false;
}
break;
}
}
}
}
添加回答
举报