This language bar is your friend. Select your favorite languages!

Idiom #57 Filter list

Create list y containing items from list x satisfying predicate p. Respect original ordering. Don't modify x in-place.

#Edit dateEdit SummaryEditor
👁 Δ 52 2019-11-12, 22:56 +keywords programming-idioms.org
👁 Δ 51 2019-10-14, 12:25 [Elixir] Dead link: play.elixirbyexample.com has been down for a while programming-idioms.org
👁 Δ 50 2019-09-28, 22:07 New Kotlin implementation by user [TiarnaNaTuaithe] TiarnaNaTuaithe
👁 Δ 49 2019-09-27, 16:49 New Fortran implementation by user [tkoenig] tkoenig
👁 Δ 48 2019-09-27, 03:31 [Python] Added comment sgdpk
👁 Δ 47 2019-09-27, 03:28 New Python implementation by user [sgdpk] sgdpk
👁 Δ 46 2019-09-26, 15:52 New Lisp implementation by user [foobar] foobar
👁 Δ 45 2019-09-26, 15:33 [Java] Updated to use streams dscholl
👁 Δ 44 2019-07-13, 14:58 New Clojure implementation by user [janqrick] janqrick
👁 Δ 43 2018-10-28, 18:12 [JS] Predicate name p. +DocURL programming-idioms.org
👁 Δ 42 2018-05-08, 00:28 [Cpp] Wrong names of variables fantasy
👁 Δ 41 2018-05-08, 00:25 New Cpp implementation by user [fantasy] fantasy
👁 Δ 40 2016-11-07, 12:24 [Ruby] Comment emphasize programming-idioms.org
👁 Δ 39 2016-11-07, 12:24 [Ruby] Comment emphasize programming-idioms.org
👁 Δ 38 2016-06-05, 15:42 [Go] Comment += allocates memory programming-idioms.org
👁 Δ 37 2016-06-05, 15:31 Linked to idiom #136 [ Remove all occurrences of a value from a list] programming-idioms.org
👁 Δ 36 2016-04-12, 20:30 [Ruby] Use required variable names
👁 Δ 35 2016-02-18, 17:24 Restored version 33
👁 Δ 34 2016-02-18, 16:58 New Csharp implementation by user [javasucks]
👁 Δ 33 2016-02-17, 15:59 New Ada implementation by user [Smaehtin]
👁 Δ 32 2016-02-17, 11:02 New Csharp implementation by user [javasucks]
👁 Δ 31 2016-02-16, 16:24 [D] Duplicate answer and in-code comments
👁 Δ 30 2016-02-16, 16:10 New Lua implementation by user [jparoz]
👁 Δ 29 2015-12-08, 21:34 [Go]Fixed alloc len/cap, +new demo URL
👁 Δ 28 2015-12-08, 21:32 [Go]Better have only 1 allocation
👁 Δ 27 2015-11-30, 12:37 New Erlang implementation by user [elbrujohalcon]
👁 Δ 26 2015-11-18, 12:02 New Erlang implementation by user [elbrujohalcon]
👁 Δ 25 2015-11-18, 12:02 New Erlang implementation by user [elbrujohalcon]
👁 Δ 24 2015-10-29, 14:05
👁 Δ 23 2015-09-04, 12:03
👁 Δ 22 2015-09-03, 15:25
👁 Δ 21 2015-09-03, 13:57
👁 Δ 20 2015-08-26, 21:12
👁 Δ 19 2015-08-23, 00:46
👁 Δ 18 2015-08-23, 00:44
👁 Δ 17 2015-08-21, 09:00
👁 Δ 16 2015-08-20, 15:56
👁 Δ 15 2015-08-20, 15:53
👁 Δ 14 2015-08-20, 06:21
👁 Δ 13 2015-08-19, 15:07
👁 Δ 12 2015-08-19, 15:06
👁 Δ 11 2015-08-18, 13:48
👁 Δ 10 2015-08-01, 17:02
👁 Δ 9 2015-07-31, 19:24
👁 Δ 8 2015-05-06, 21:04
👁 Δ 7 2015-03-01, 16:13
👁 Δ 6 2015-01-16, 00:02
👁 Δ 5 2015-01-16, 00:01
👁 Δ 4 2015-01-15, 23:44
👁 Δ 3 2015-01-15, 23:37
👁 Δ 2 2015-01-15, 23:36
1 2015-01-15, 23:27