# Is there an easy way to initialize+fill a large array of strings?

**URL:** <https://discourse.julialang.org/t/is-there-an-easy-way-to-initialize-fill-a-large-array-of-strings/18184>\
**Category:** New to Julia\
**Created:** [November 30, 2018, 2:56pm UTC](https://discourse.julialang.org/t/is-there-an-easy-way-to-initialize-fill-a-large-array-of-strings/18184 "2018-11-30T14:56:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![drmartinrohde](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@drmartinrohde](https://discourse.julialang.org/u/drmartinrohde)\
**Post date:** [November 30, 2018, 2:56pm UTC](https://discourse.julialang.org/t/is-there-an-easy-way-to-initialize-fill-a-large-array-of-strings/18184/1 "2018-11-30T14:56:36Z")

</div>

I am looking for a way to initialise + fill a large array of String values, analogous to the method to initialise+fill an array of e.g. Floats: A = zeros(Float64,1000). Is there such a method for strings?

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [November 30, 2018, 2:59pm UTC](https://discourse.julialang.org/t/is-there-an-easy-way-to-initialize-fill-a-large-array-of-strings/18184/2 "2018-11-30T14:59:48Z")

</div>

```julia
julia> fill("", 10)
10-element Array{String,1}:
 ""
 ""
 ""
 ""
 ""
 ""
 ""
 ""
 ""
 ""

julia> ["*"^k for k=1:10]
10-element Array{String,1}:
 "*"
 "**"
 "***"
 " ****"
 " *****"
 " ******"
 " *******"
 " ********"
 " *********"
 " **********"

```

---

<div class="post-metadata">

**Author:** ![drmartinrohde](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@drmartinrohde](https://discourse.julialang.org/u/drmartinrohde)\
**Post date:** [November 30, 2018, 3:05pm UTC](https://discourse.julialang.org/t/is-there-an-easy-way-to-initialize-fill-a-large-array-of-strings/18184/3 "2018-11-30T15:05:02Z")

</div>

This works, thank you very much!!

> [@StefanKarpinski](#):
>
> fill(“”, 10)
