"contains" as operator?

This works

filter( ∈([1,2]), [1,2,3,4,5] )

Though this gives an error

∈ₛ(a,b) = contains(a,b)

filter( ∈ₛ("aa"), ["baab","aaO","tt"] )

Is it possible to to a contains filter like this without an anonymous function ?

Sure, just define another method:

∈ₛ(a) = contains(a)

julia> filter( ∈ₛ("aa"), ["baab","aaO","tt"] )
2-element Vector{String}:
 "baab"
 "aaO"
2 Likes