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

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -