- Processing
- p5.js
- Processing.py
- Processing for Android
- Processing for Pi

- Processing Foundation

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.

Name | ### expand()
Examples |
    int[] data = {0, 1, 3, 4};
    println(data.length);  // Prints "4"
    data = expand(data);
    println(data.length);  // Prints "8"
    data = expand(data, 512);
    println(data.length);  // Prints "512"
    PImage[] imgs = new PImage[32];
    println(imgs.length);  // Prints "32"
    imgs = (PImage[]) expand(imgs);
    println(imgs.length);  // Prints "64"
Description | Increases the size of a one-dimensional array. By default, this function doubles the size of the array, but the optional newSize parameter provides precise control over the increase in size. 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[]) expand(originalArray)
Syntax |
    expand(list)
    expand(list, newSize)
Parameters |
list | Object, String[], double[], float[], long[], int[], char[], byte[], or boolean[]: the array to expand
newSize | int: new size for the array
Returns | boolean[], byte[], char[], int[], long[], float[], double[], String[], or Object
Related | shorten()

Updated on January 1, 2021 03:38:07am EST
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.