【发布时间】:2019-08-02 14:23:19
【问题描述】:
我有一个由 2 个字符串组成的对象列表 - class X {StringA, StringB;}。我需要字符串 A 和字符串 B (StringA + StringB) 的串联值列表,并对其应用过滤器。过滤器就像 - StringA.contains(pattern) || StringB.contains(pattern)。我如何实现这一目标?我尝试使用 toList 但由于我的初始列表不是字符串,我无法理解。
【问题讨论】:
-
"but since my initial list is not of strings, I am unable to understand."- 使用Iterable#map