This question was asked here:
Remove empty strings from array while keeping record of indexes with non empty strings
If you'd notice the given as @Baz layed it out;
"I", "am", "", "still", "here", "", "man"
"and from this I wish to produce the following two arrays:"
"I", "am", "still", "here", "man"
All the Answers to this question referred to a form of looping.
My question: Is there a possibility to remove all index
es with empty
string
without any looping? ... is there any other alternative apart from iterating the array?
May be some regex
or some jQuery
that we are not aware of?
All answers or suggestions are highly appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…