Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Tell me how do you remove nil values in array using ruby?



Tell me how do you remove nil values in array using ruby?..

Answer / Gaurav Krishan

"In Ruby, you can remove all nil elements from an array by calling the compact method on it. Example: arr = [1,nil,2,nil].compact will return [1,2]."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby Interview Questions

What does mri most commonly stand for?

1 Answers  


How is object methods defined in ruby?

1 Answers  


How to create ruby object?

1 Answers  


What is the use of global variable $ in Ruby?

1 Answers  


What is the use of interpolation in ruby?

1 Answers  


Difference between nil and false in ruby?

1 Answers  


What are advantages of using ruby?

1 Answers  


what is Interpolation in Ruby?

1 Answers  


In how many ways you can compare Ruby string?

1 Answers  


What are the different uses of ruby modules?

1 Answers  


Please explain what is mvc and why do we use it?

1 Answers  


How is class methods defined in ruby?

1 Answers  


Categories