Programming-Idioms

History of Idiom 135

Idiom #135 Remove item from list, by its value

Remove at most 1 item from list items, having value x.
This will alter the original list or return a new list, depending on which is more idiomatic.
If there are several occurrences of x in items, remove only one of them. If x is absent, keep items unchanged.

#Edit dateEdit SummaryAuthor
👁 Δ 46 2021-01-07, 09:29 Linked to idiom #254 [Replace value in list] programming-idioms.org
👁 Δ 45 2020-09-30, 09:20 [Python] +DocURL, +comment programming-idioms.org
👁 Δ 44 2020-09-30, 09:18 [Pascal] Variable name x programming-idioms.org
👁 Δ 43 2020-09-30, 09:16 [Haskell] Variables items, x programming-idioms.org
👁 Δ 42 2020-09-30, 09:15 [C++] Variable names items, x programming-idioms.org
👁 Δ 41 2020-09-30, 09:13 If x is absent, keep items unchanged. programming-idioms.org
👁 Δ 40 2020-09-30, 09:12 Admin deletes impl 2876: This doesn't properly handle x not found and indexOf returning -1 programming-idioms.org
👁 Δ 39 2020-09-30, 09:10 Admin deletes impl 2889: This doesn't properly handle x not found and indexOd returning -1 programming-idioms.org
👁 Δ 38 2020-09-30, 09:08 Admin deletes impl 2865: This would remove all occurrences, instead of just 1 programming-idioms.org
👁 Δ 37 2020-05-03, 21:28 Admin deletes impl 3955: No items programming-idioms.org
👁 Δ 36 2020-05-03, 21:28 Admin deletes impl 3954: No items programming-idioms.org
👁 Δ 35 2020-04-29, 17:47 New Elixir implementation by user [Matt] Matt
👁 Δ 34 2020-04-29, 16:42 New Clojure implementation by user [misha] misha
👁 Δ 33 2020-04-29, 16:39 New Clojure implementation by user [misha] misha
👁 Δ 32 2019-09-27, 20:59 [Cpp] It looks like the other examples didn't also show declaring the list itself. chardan
👁 Δ 31 2019-09-27, 20:57 New Cpp implementation by user [chardan] chardan
👁 Δ 30 2019-09-27, 16:06 New Csharp implementation by user [ngm] ngm
👁 Δ 29 2019-09-27, 15:44 New PHP implementation by user [Kaitlyn] Kaitlyn
👁 Δ 28 2019-09-27, 15:43 [Java] matching to x rather than another string matthewmcgibbon
👁 Δ 27 2019-09-27, 15:41 New Java implementation by user [matthewmcgibbon] matthewmcgibbon
👁 Δ 26 2019-09-27, 14:35 New Fortran implementation by user [tkoenig] tkoenig
👁 Δ 25 2019-09-27, 11:03 New Perl implementation by user [daxim] daxim
👁 Δ 24 2019-09-26, 16:56 [JS] whoops joewrong
👁 Δ 23 2019-09-26, 16:56 [JS] read the instructions after the implementation lol joewrong
👁 Δ 22 2019-09-26, 16:46 New JS implementation by user [joewrong] joewrong
👁 Δ 21 2019-09-26, 16:44 [Haskell] No new definition needed sjakobi
👁 Δ 20 2019-09-26, 16:37 New JS implementation by user [Oliphaunt] Oliphaunt
👁 Δ 19 2019-09-26, 16:34 [JS] test test
👁 Δ 18 2019-09-26, 16:23 New JS implementation by user [me] me
👁 Δ 17 2018-09-22, 15:17 [D] typo programming-idioms.org
👁 Δ 16 2018-09-21, 13:15 New D implementation by user [duser] duser
👁 Δ 15 2018-06-12, 20:44 New Rust implementation by user [GobbleCock] GobbleCock
👁 Δ 14 2018-03-27, 21:52 Admin deletes impl 1773 programming-idioms.org
👁 Δ 13 2018-03-27, 21:51 [D] Doesn't seem to work programming-idioms.org
👁 Δ 12 2018-01-17, 16:53 [Dart] typing mistake Edward E.
👁 Δ 11 2018-01-17, 16:52 New Dart implementation by user [Edward E.] Edward E.
👁 Δ 10 2017-10-28, 12:32 New Python implementation by user [Oldboy] Oldboy
👁 Δ 9 2017-09-21, 18:57 New Haskell implementation by user [Alekzcb] Alekzcb
👁 Δ 8 2016-08-23, 13:20 New Pascal implementation by user [BBaz] BBaz
👁 Δ 7 2016-08-13, 21:25 New D implementation by user [BBaz] BBaz
👁 Δ 6 2016-06-13, 18:44 New Ruby implementation by user [steenslag] steenslag
👁 Δ 5 2016-06-05, 18:04 New Go implementation by user [programming-idioms.org] programming-idioms.org
👁 Δ 4 2016-06-05, 16:57 [Go] Comment += memory leak programming-idioms.org
👁 Δ 3 2016-06-05, 15:31 Linked to idiom #136 [ Remove all occurrences of a value from a list] programming-idioms.org
👁 Δ 2 2016-06-05, 15:23 Linked to idiom #29 [Remove item from list, by its index] programming-idioms.org
1 2016-06-05, 15:22 Idiom creation by user [programming-idioms.org] programming-idioms.org