Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
因此,我通常使用 for each 循环来查找数组列表中某些内容的匹配项,但是一旦找到匹配项,循环就会停止,如何让它继续搜索并找到所有匹配项,甚至可能将匹配项存储在新的数组列表中?
遍历整个集合 - 将匹配的对象推入“经过审查”的数组列表(或向量?)并且在第一次匹配时不终止 for 循环的处理?