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

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -