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

Idiom #44 Insert element in list

Insert element x at position i in list s. Further elements must be shifted to the right.

Illustration
#Edit dateEdit SummaryEditor
👁 Δ 37 2019-10-30, 12:25 New JS implementation by user [hjlpb] hjlpb
👁 Δ 36 2019-10-14, 12:24 [Elixir] Dead link: play.elixirbyexample.com has been down for a while programming-idioms.org
👁 Δ 35 2019-09-30, 14:29 New VB implementation by user [silver-dragon] silver-dragon
👁 Δ 34 2019-09-27, 13:45 New Fortran implementation by user [tkoenig] tkoenig
👁 Δ 33 2019-09-26, 16:11 New Csharp implementation by user [TotallyGatsby] TotallyGatsby
👁 Δ 32 2018-08-06, 15:25 Linked to idiom #171 [Add an element at the end of a list] programming-idioms.org
👁 Δ 31 2018-05-08, 01:35 New Cpp implementation by user [fantasy] fantasy
👁 Δ 30 2017-04-06, 10:02 Linked to idiom #158 [Random sublist] programming-idioms.org
👁 Δ 29 2016-09-27, 11:40 Updated picture URL by user [programming-idioms.org] programming-idioms.org
👁 Δ 28 2016-09-27, 11:32 [Go] Emphasize in comment. +DocURL to append. +updated origin URL. programming-idioms.org
👁 Δ 27 2016-04-07, 14:26 New Lua implementation by user [Nepta]
👁 Δ 26 2016-02-18, 16:57 [Pascal] Fixed param order. Removed useless lines. +DocURL.
👁 Δ 25 2016-02-07, 21:07 [Pascal] Fixed param order. Removed useless lines. +DocURL.
👁 Δ 24 2016-02-07, 17:32 [Pascal] Proper import. List name is s. Removed var/begin/end. Comment outside the code.
👁 Δ 23 2016-01-26, 02:29 New Erlang implementation by user [elbrujohalcon]
👁 Δ 22 2015-11-30, 12:37 Comment format
👁 Δ 21 2015-11-03, 22:19 Comment format
👁 Δ 20 2015-10-29, 14:05
👁 Δ 19 2015-09-04, 18:04
👁 Δ 18 2015-09-04, 18:00
👁 Δ 17 2015-09-04, 12:21
👁 Δ 16 2015-09-03, 16:28
👁 Δ 15 2015-08-22, 21:06
👁 Δ 14 2015-08-21, 23:20
👁 Δ 13 2015-08-21, 23:19
👁 Δ 12 2015-08-21, 16:54
👁 Δ 11 2015-08-20, 16:35
👁 Δ 10 2015-08-20, 08:09
👁 Δ 9 2015-08-19, 17:24
👁 Δ 8 2015-08-01, 17:46
👁 Δ 7 2015-08-01, 17:46
👁 Δ 6 2015-08-01, 17:44
👁 Δ 5 2015-08-01, 17:43
👁 Δ 4 2015-08-01, 17:43
👁 Δ 3 2015-08-01, 17:43
👁 Δ 2 2015-07-31, 19:53
1 2015-05-06, 21:04