programming-language配列基本操作filter(抽出,where)On this pagefilter(抽出,where) Python pyfilter(func, items)[x for x in items if func(x)] pyitems = [1, 2, 3, 4, 5]filter(lambda x : x < 3, items) # => [1, 2][x for x in [1, 2, 3, 4, 5] if x < 3] # => [1, 2] Swift swiftitems.filter(Closure) PHP phparray_filter($arr1, 'strlen'); 📩 ご意見・ご感想はこちらから