我有以下内容:
a_disposition = [nil,'test','demo']
a_volume = a_disposition.count{|x| x != nil}
Run Code Online (Sandbox Code Playgroud)
我想要计算所有非NOT nil和NOT的值'test'.什么是红宝石的说法count where x is not nil and x is not 'test'?我正在使用ruby 2.0.
| 归档时间: |
|
| 查看次数: |
453 次 |
| 最近记录: |