本文简要介绍ruby语言中  Array.array - other_array  的用法。
用法
array - other_array → new_array返回一个新数组,其中仅包含 array 中未在数组 other_array 中找到的那些元素;使用 eql? 比较项目; array 的顺序被保留:
[0, 1, 1, 2, 1, 1, 3, 1, 1] - [1] # => [0, 2, 3]
[0, 1, 2, 3] - [3, 0] # => [1, 2]
[0, 1, 2] - [4] # => [0, 1, 2]相关: Array#difference 。
相关用法
- Ruby Array.array + other_array用法及代码示例
- Ruby Array.array | other_array用法及代码示例
- Ruby Array.array ==用法及代码示例
- Ruby Array.array & other_array用法及代码示例
- Ruby Array.array <=>用法及代码示例
- Ruby Array.array << object用法及代码示例
- Ruby Array.array * n用法及代码示例
- Ruby Array.array[index]用法及代码示例
- Ruby Array.array[index] =用法及代码示例
- Ruby Array.assoc(obj)用法及代码示例
- Ruby Array.abbrev用法及代码示例
- Ruby Array.assoc用法及代码示例
- Ruby Array.all?用法及代码示例
- Ruby Array.at用法及代码示例
- Ruby Array.append用法及代码示例
- Ruby Array.any?用法及代码示例
- Ruby Array.push用法及代码示例
- Ruby Array.hash用法及代码示例
- Ruby Array.to_a用法及代码示例
- Ruby Array.to_h用法及代码示例
- Ruby Array.to_s用法及代码示例
- Ruby Array.take()用法及代码示例
- Ruby Array.reject!用法及代码示例
- Ruby Array.flatten!用法及代码示例
- Ruby Array.reject用法及代码示例
注:本文由纯净天空筛选整理自ruby-lang.org大神的英文原创作品 Array.array - other_array。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
