I am looking for efficient solution to remove empty string in a list in Julia.
Here is my list :
li = ["one", "two", "three", " ", "four", "five"]
I can remove empty string by using for loop, as following :
new_li = []
for i in li
if i == " "
else
push!(new_li, i)
end
end
But I believe there is more efficient way to remove the empty string.
>Solution :
new_li = filter((i) -> i != " ", l)
or
new_li = [i for i in l if i != " "]