concat()

本参考资料用于Processing 3.0+。 如果你使用的是前一版本,请在使用软件帮助菜单内的参考资料。. 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.

名称

concat()

示例
 String[] sa1 ={ "OH", "NY", "CA"  };

String[] sa2 ={ "KY", "IN", "MA"  };

String[] sa3 = concat(sa1, sa2);

println(sa3);

// Prints updated array contents to the console: // [0] "OH" // [1] "NY" // [2] "CA" // [3] "KY" // [4] "IN" // [5] "MA" 
描述 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
返回值 boolean[], byte[], char[],
int[],float[], String[], or Object
相关 splice()
arrayCopy()

Updated on October 2, 2018 05:02:07pm EDT

concat()