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

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

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

Paul

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.

1 Like
[s for s in yourarray if !isempty(s)]
2 Likes
obj = ["", "a", "", "b", ""]
filter(!isempty, obj) # standard way
filter!(!isempty, obj) # in-place variant
5 Likes