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

Interpolation is a very important process in Ruby, comment.

1 Answers  


What does ruby name refers to?

1 Answers  


What is the naming conventions for methods that return a boolean result?

1 Answers  


Name some operators used in ruby.

1 Answers  


Mention what is the difference between a gem and a plugin in ruby?

1 Answers  


What are ruby variables.

1 Answers  


what is the difference between String and Symbol?

1 Answers  


What is the difference between extend and include?

1 Answers  


What is the difference between “#==” and “#equal?”

1 Answers  


Explain do while loop in ruby.

1 Answers  


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

1 Answers  


List some features of ruby?

1 Answers  


Categories