【发布时间】:2013-06-08 06:20:48
【问题描述】:
亲爱的,如果两个值相同,我正在比较 android 中的两个 List 并且返回 true 很好,但我想知道列表字符串之间有多少值是正确的,如果它不匹配如何实现此帮助赞赏。下面是我的代码。
List<String> list1 = new ArrayList<String>(i1.values());
///list 1 = [-ful; to be full of; play; playful; full of play]
List<String> acct_Rte_Cdes_A = Arrays.asList(result) ;
///acct_Rte_Cdes_A = [-ful; to be full of; play; playful; full of play]
if (list1.equals(acct_Rte_Cdes_A)) {
// do what you want to do if the string is there
//System.out.println("True");
} else {
System.out.println("False");
}
【问题讨论】:
-
如果它们不相等,则循环遍历它们自己比较项目,并保留一个简单的整数作为计数,每次项目匹配时递增。
-
在同一个问题上遇到了困难,你得到答案了吗?如果是这样,请发布正确的答案。我需要从两个列表中获取共同值。我关注了一些帖子,但那不起作用。
标签: android string list equals