Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
- Clojure
- C++
- C#
- D
- D
- Dart
- Elixir
- Erlang
- Fortran
- Go
- Go
- Go
- Haskell
- JS
- Java
- Java
- Kotlin
- Lisp
- Lua
- Lua
- Obj-C
- PHP
- Pascal
- Perl
- Python
- Python
- Ruby
- Rust
- Scala
- Scala
- Scheme
- Smalltalk
(def ab (concat a b))
auto ab = a;
ab.insert (ab.end (), b.begin (), b.end ());
var list1 = new List<int>(){1,2,3};
var list2 = new List<int>(){4,5,6};
var list3 = list1.Concat(list2);
This returns new array.
Use AddRange() to add items to the same array
Use AddRange() to add items to the same array
int[] a, b;
auto ab = a ~ b;
Using built-in arrays
ab = a ++ b
AB = A ++ B.
real, dimension(:), allocatable :: ab
ab = [a, b]
var ab = a.concat(b);
This returns a new array.
val ab = a + b
(setf ab (append a b))
ab = {}
table.foreach(a, function(k, v) table.insert(ab, v) end)
table.foreach(b, function(k, v) table.insert(ab, v) end)
ab = {}
table.move(a, 1, #a, 1, ab)
table.move(b, 1, #b, #ab + 1, ab)
@ab = (@a, @b)
ab = a + b
val ab = a ::: b
::: is specific to List.
Both a and b must be of type List.
::: is more efficient than ++ when concatenating more than 2 lists.
Both a and b must be of type List.
::: is more efficient than ++ when concatenating more than 2 lists.
val ab = a ++ b
(define ab (append a b))
ab := a,b