清单9中的filter方法接受了一个list和一个criteria(指定如何过滤列表的代码块)并对列表进行遍历,将满足谓语的项添加到一个新列表中。
The filter method in Listing 9 accepts a list and a criteria (a code block specifying how to filter the list) and iterates over the list, adding each item to a new list if it matches the predicate.
清单9中的filter方法接受了一个list和一个criteria(指定如何过滤列表的代码块)并对列表进行遍历,将满足谓语的项添加到一个新列表中。
The filter method in Listing 9 accepts a list and a criteria (a code block specifying how to filter the list) and iterates over the list, adding each item to a new list if it matches the predicate.
应用推荐