I have the following array
cities = ["Kathmandu", "Pokhara", "", "Dharan", "Butwal"]
I want to remove blank elements from the array and want the following result:
cities = ["Kathmandu", "Pokhara", "Dharan", "Butwal"]
Is there any method like compact
that will do it without loops?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…