当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Dart AttributeClassSet.intersection用法及代码示例


dart:svg 库中AttributeClassSet.intersection 方法的用法介绍如下。

用法:

Set<String> intersection(
   Set<Object?> other   
)
      inherited

创建一个新集,该集是该集与 other 的交集。

也就是说,返回的集合包含此 Set 的所有元素,根据 other.contains 也是 other 的元素。

final characters1 = <String>{'A', 'B', 'C'};
final characters2 = <String>{'A', 'E', 'F'};
final unionSet = characters1.intersection(characters2);
print(unionSet); // {A}

相关用法


注:本文由纯净天空筛选整理自dart.dev大神的英文原创作品 intersection method。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。