fork download
  1. arr = ["samsung,","htc,","general-mobile","lg,","iphone,"]
  2.  
  3. i=0
  4. temp = []
  5. while(i<arr.length)
  6. temp << arr[i].chop.size if arr[i].include? ','
  7. i += 1
  8. end
  9.  
  10. p temp
  11.  
Success #stdin #stdout 0s 29112KB
stdin
Standard input is empty
stdout
[7, 3, 2, 6]