Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby remove nil element in array

[nil, 'apple', 'orange', '', 'banana'].compact
=> ["apple", "orange", "", "banana"]
Source by rubysnippets.net #
 
PREVIOUS NEXT
Tagged: #ruby #remove #nil #element #array
ADD COMMENT
Topic
Name
1+4 =