How to find which subtypes are contained in a type

Hi there,

Difficult to explain issue but an example should be clear:

I have a column of type:
Vector{Union{Missing, String}}

I want to check if String is contained in this type.

String <: Vector{Union{Missing, String}}
evaluates to false (which makes sense as it’s not a subtype).

Is there a way to check whether String is contained in this type?

Thanks!

eltype provides the element type in a collection. Does this what you need?
String <: eltype(Vector{Union{Missing, String}})

1 Like

Yes. It is. Thanks!