# Override printed representation of vectors

**URL:** https://discourse.julialang.org/t/override-printed-representation-of-vectors/35407
**Category:** New to Julia
**Tags:** question
**Created:** [March 2, 2020, 2:14pm UTC](https://discourse.julialang.org/t/override-printed-representation-of-vectors/35407 "2020-03-02T14:14:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ea42gh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ea42gh/32/12000_2.png) [@ea42gh](https://discourse.julialang.org/u/ea42gh)
#### Post date: [March 2, 2020, 2:14pm UTC](https://discourse.julialang.org/t/override-printed-representation-of-vectors/35407/1 "2020-03-02T14:14:38Z")

</div>

Is there a way to override the print representation of a complex vector?

```julia
u=[1 2]; println( "u=$u")
u=[1im 2]; println( "u=$u")

```

yields

```julia
u=[1 2]
u=Complex{Int64}[0 + 1im 2 + 0im]

```

I want to get rid of the type specification; yes, I could write some code,  
but is there some simple way to achieve this?

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [March 2, 2020, 5:07pm UTC](https://discourse.julialang.org/t/override-printed-representation-of-vectors/35407/2 "2020-03-02T17:07:29Z")

</div>

You could call

```julia
Base.print_array(stdout, u)

```

which outputs bare-bones contents (without even the brackets). This is an undocumented internal function, however.

---

<div class="post-metadata">

### Author: ![ea42gh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ea42gh/32/12000_2.png) [@ea42gh](https://discourse.julialang.org/u/ea42gh)
#### Post date: [March 3, 2020, 4:53am UTC](https://discourse.julialang.org/t/override-printed-representation-of-vectors/35407/3 "2020-03-03T04:53:55Z")

</div>

Thank you, that works  
`print("["); Base.print_array(stdout, [1im 2+2im]); println("]")`  
yields  
`[0 + 1im 2 + 2im]`  
still a bit hard to read due to the spaces, but no user code required!
