Name | arrayCopy() |
||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Examples | String[] north = { "OH", "IN", "MI"}; String[] south = { "GA", "FL", "NC"}; arrayCopy(north, south); print(south); // Prints OH, IN, MI String[] north = { "OH", "IN", "MI"}; String[] south = { "GA", "FL", "NC"}; arrayCopy(north, 1, south, 0, 2); println(south); // Prints IN, MI, NC |
||||||||||
Description |
Copies an array (or part of an array) to another array. The src array is copied to the dst array, beginning at the position specified by srcPos and into the position specified by dstPos. The number of elements to copy is determined by length. The simplified version with two arguments copies an entire array to another of the same size. It is equivalent to "arrayCopy(src, 0, dst, 0, src.length)". This function is far more efficient for copying array data than iterating through a for and copying each element. |
||||||||||
Syntax | arrayCopy(src,dest) arrayCopy(src,dest,length) |
||||||||||
Parameters |
|
||||||||||
Returns | None | ||||||||||
Usage | Web & Application |