I have the following array
cities = [\"Kathmandu\", \"Pokhara\", \"\", \"Dharan\", \"Butwal\"]
I want to remove blank elements from the ar
Here is one more approach to achieve this
we can use presence with select
presence
select
cities = ["Kathmandu", "Pokhara", "", "Dharan", nil, "Butwal"] cities.select(&:presence) ["Kathmandu", "Pokhara", "Dharan", "Butwal"]