# How to find which subtypes are contained in a type

**URL:** <https://discourse.julialang.org/t/how-to-find-which-subtypes-are-contained-in-a-type/59144>\
**Category:** New to Julia\
**Created:** [April 13, 2021, 3:59am UTC](https://discourse.julialang.org/t/how-to-find-which-subtypes-are-contained-in-a-type/59144 "2021-04-13T03:59:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SpinolaHours](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@SpinolaHours](https://discourse.julialang.org/u/SpinolaHours)\
**Post date:** [April 13, 2021, 3:59am UTC](https://discourse.julialang.org/t/how-to-find-which-subtypes-are-contained-in-a-type/59144/1 "2021-04-13T03:59:34Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![AndiMD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andimd/32/6531_2.png) [@AndiMD](https://discourse.julialang.org/u/AndiMD)\
**Post date:** [April 13, 2021, 4:54am UTC](https://discourse.julialang.org/t/how-to-find-which-subtypes-are-contained-in-a-type/59144/2 "2021-04-13T04:54:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![SpinolaHours](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@SpinolaHours](https://discourse.julialang.org/u/SpinolaHours)\
**Post date:** [April 13, 2021, 6:55am UTC](https://discourse.julialang.org/t/how-to-find-which-subtypes-are-contained-in-a-type/59144/3 "2021-04-13T06:55:49Z")

</div>

Yes. It is. Thanks!
