# How to remowe empty rows in Array{String,1}?

**URL:** https://discourse.julialang.org/t/how-to-remowe-empty-rows-in-array-string-1/9125
**Category:** General Usage
**Created:** [February 17, 2018, 9:30am UTC](https://discourse.julialang.org/t/how-to-remowe-empty-rows-in-array-string-1/9125 "2018-02-17T09:30:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![programista](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/programista/32/5372_2.png) [@programista](https://discourse.julialang.org/u/programista)
#### Post date: [February 17, 2018, 9:30am UTC](https://discourse.julialang.org/t/how-to-remowe-empty-rows-in-array-string-1/9125/1 "2018-02-17T09:30:11Z")

</div>

How to remowe empty rows in Array{String,1} ?

'2993-element Array{String,1}:  
“”  
“”  
“”  
“”  
“”  
“some test”  
“”  
’  
Paul

---

<div class="post-metadata">

### Author: ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)
#### Post date: [February 17, 2018, 9:34am UTC](https://discourse.julialang.org/t/how-to-remowe-empty-rows-in-array-string-1/9125/2 "2018-02-17T09:34:51Z")

</div>

How did you create the array? You can test for an empty string when you create it. Or just make a new array without the empty strings in.

---

<div class="post-metadata">

### Author: ![jandehaan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jandehaan/32/6805_2.png) [@jandehaan](https://discourse.julialang.org/u/jandehaan)
#### Post date: [February 17, 2018, 9:55am UTC](https://discourse.julialang.org/t/how-to-remowe-empty-rows-in-array-string-1/9125/3 "2018-02-17T09:55:42Z")

</div>

```julia
[s for s in yourarray if !isempty(s)]

```

---

<div class="post-metadata">

### Author: ![Nosferican](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nosferican/32/9275_2.png) [@Nosferican](https://discourse.julialang.org/u/Nosferican)
#### Post date: [February 17, 2018, 1:46pm UTC](https://discourse.julialang.org/t/how-to-remowe-empty-rows-in-array-string-1/9125/4 "2018-02-17T13:46:58Z")

</div>

```julia
obj = ["", "a", "", "b", ""]
filter(!isempty, obj) # standard way
filter!(!isempty, obj) # in-place variant

```
