Name

set()

Class

StringDict

Description

Create a new key/value pair or change the value of one

Examples

  • StringDict inventory;
    
    void setup() {
      size(200, 200);
      inventory = new StringDict();
      inventory.set("coffee","black");
      inventory.set("flour","white");
      inventory.set("tea","green");
      println(inventory);
      inventory.set("flour", "unbleached");
      inventory.set("cinnamon", "brown");
      println(inventory);
    }
    
    

Syntax

  • .set(key, value)

Return

  • void