chef - How do you check if an array element is empty or not in Ruby? -
how check if array element empty or not in ruby?
passwd.where { user =~ /.*/ }.uids => ["0", "108", "109", "110", "111", "112", "994", "995", "1001", "1002", "", "65534"]
not sure want it, there quite few ways skin cat. more info narrow down some...
["0", "108", "109", "110", "111", "112", "994", "995", "1001", "1002", "", "65534"].map { |v| v.empty? } => [false, false, false, false, false, false, false, false, false, false, true, false] ["0", "108", "109", "110", "111", "112", "994", "995", "1001", "1002", "", "65534"].each_with_index { |v,i| puts if v.empty? } 10
Comments
Post a Comment