Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby remove nil & empty element in array

[nil, 'apple', 'orange', '', 'banana'].reject(&:blank?)
=> ["apple", "orange", "banana"]
Source by rubysnippets.net #
 
PREVIOUS NEXT
Tagged: #ruby #remove #nil #empty #element #array
ADD COMMENT
Topic
Name
2+2 =