This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software in the Help menu. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.



String[] sa1 = { "OH", "NY", "CA"};
String[] sa2 = { "KY", "IN", "MA"};
String[] sa3 = concat(sa1, sa2);
// Prints updated array contents to the console:
// [0] "OH"
// [1] "NY"
// [2] "CA"
// [3] "KY"
// [4] "IN"
// [5] "MA"
Description Concatenates two arrays. For example, concatenating the array { 1, 2, 3 } and the array { 4, 5, 6 } yields { 1, 2, 3, 4, 5, 6 }. Both parameters must be arrays of the same datatype.

When using an array of objects, the data returned from the function must be cast to the object array's data type. For example: SomeClass[] items = (SomeClass[]) concat(array1, array2).
concat(a, b)
a Object, String[], float[], int[], char[], byte[], or boolean[]: first array to concatenate
b Object, String[], float[], int[], char[], byte[], or boolean[]: second array to concatenate
Returnsboolean[], byte[], char[], int[], float[], String[], or Object
Updated on June 6, 2020 10:05:47pm EDT