Name

get()

Class

StringList

Description

Get an entry at a particular index.

Examples

  • StringList inventory;
    
    void setup() {
      size(200, 200);
      inventory = new StringList();
      inventory.append("coffee");
      inventory.append("flour");
      inventory.append("tea");
      println(inventory);
      noLoop();
      fill(0);
      textAlign(CENTER);
    }
    
    void draw() {
      String item = inventory.get(2);
      text(item, width/2, height/2);
    }
    
    

Syntax

  • .get(index)

Return

  • String