# Design choice for printing strings in Arrays

**URL:** <https://discourse.julialang.org/t/design-choice-for-printing-strings-in-arrays/6974>\
**Category:** Internals & Design\
**Created:** [November 9, 2017, 7:31am UTC](https://discourse.julialang.org/t/design-choice-for-printing-strings-in-arrays/6974 "2017-11-09T07:31:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Azzaare](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/azzaare/32/21008_2.png) [@Azzaare](https://discourse.julialang.org/u/Azzaare)\
**Post date:** [November 9, 2017, 7:31am UTC](https://discourse.julialang.org/t/design-choice-for-printing-strings-in-arrays/6974/1 "2017-11-09T07:31:26Z")

</div>

I run up in an odd way of printing strings (compared to numbers per say) in a Vector.

```nohighlight
julia> [1, 2.9,"test", 3, "test2"]
5-element Array{Any,1}:
 1
 2.9
  "test"
 3
  "test2"

```

Why is there a space before each string only ? Is it on purpose for readability in printing Arrays of strings ?

If there is no reason, I propose we make it coherent with the rest.

---

<div class="post-metadata">

**Author:** ![rfourquet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rfourquet/32/3610_2.png) [@rfourquet](https://discourse.julialang.org/u/rfourquet)\
**Post date:** [November 9, 2017, 8:29am UTC](https://discourse.julialang.org/t/design-choice-for-printing-strings-in-arrays/6974/2 "2017-11-09T08:29:28Z")

</div>

This is due to julia having an “alignment” concept essentially for printing numbers aligned to the decimal point, or e.g. pairs aligned to their arrows; but this doesn’t play so well for heterogeneous arrays, as the array has only one such vertical line for alignment. This is not specific to strings by the way, e.g. printing a custom object without a specialized `show` will also be aligned like strings (i.e. aligned to the decimal point). But I agree it would be nicer to left-align those.
