用法:
∉(item, collection) -> Bool
∌(collection, item) -> Bool∈ 和 ∋ 的否定,即检查 item 是否不在 collection 中。
当使用 items .∉ collection 进行广播时,item 和 collection 都会被广播,这通常不是预期的。例如,如果两个参数都是向量(并且维度匹配),则结果是一个向量,指示集合 items 中的每个值是否不在 collection 中相应位置的值中。要获取指示 items 中的每个值是否不在 collection 中的向量,请将 collection 包装在一个元组或 Ref 中,如下所示: items .∉ Ref(collection) 。
例子
julia> 1 ∉ 2:4
true
julia> 1 ∉ 1:3
false
julia> [1, 2] .∉ [2, 3]
2-element BitVector:
 1
 1
julia> [1, 2] .∉ ([2, 3],)
2-element BitVector:
 1
 0相关用法
- Julia :<=用法及代码示例
- Julia :∘用法及代码示例
- Julia :==方法用法及代码示例
- Julia :\方法用法及代码示例
- Julia :|用法及代码示例
- Julia :*方法用法及代码示例
- Julia :|>用法及代码示例
- Julia ://用法及代码示例
- Julia :^方法用法及代码示例
- Julia :!==用法及代码示例
- Julia :>>>用法及代码示例
- Julia :<<用法及代码示例
- Julia :!=用法及代码示例
- Julia :>=用法及代码示例
- Julia :-方法用法及代码示例
- Julia :⊈用法及代码示例
- Julia :⊊用法及代码示例
- Julia :<用法及代码示例
- Julia :+用法及代码示例
- Julia :~用法及代码示例
- Julia :/用法及代码示例
- Julia :!用法及代码示例
- Julia :>用法及代码示例
- Julia :>>用法及代码示例
- Julia ::用法及代码示例
注:本文由纯净天空筛选整理自julialang.org 大神的英文原创作品 Base.:∉ — Function。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
