ruby array.count

> a = Array[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
> puts a.count { |v| v < 5 }

原文地址:https://www.cnblogs.com/lexus/p/1910110.html