GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Processing
  • Download
  • Reference
  • Environment
  • Libraries
  • Tools
  • Wiki
  • Tutorials
  • Examples
  • Books
  • Forum
  • Overview
  • People
  • Privacy

This view

  • Original page
  • New address

GeezerVison is showing www.processing.org — setString() / Reference

Reference+
Documentation→Reference→Data→Composite→JSONArray

Name

setString()

Class

JSONArray

Description

Inserts a new value into the JSONArray at the specified index position. If a value already exists in the specified position, the new value overwrites the old value. If the given index is greater than the length of the JSONArray, then null elements will be added as necessary to pad it out.

Examples

  • JSONArray json;
    
    void setup() {
    
      json = new JSONArray();
    
      json.setInt(0, 32);
      json.setFloat(1, 1.5);
      json.setString(2, "grape");
      json.setBoolean(3, true);
    
      println(json);
    }
    
    // Sketch prints:
    // [
    //   32,
    //   1.5,
    //   "grape",
    //   true
    // ]
    

Syntax

  • .setString(index, value)

Parameters

  • index(int)an index value
  • value(String)the value to assign

Return

  • JSONArray

Related

  • JSONArray::setInt()
  • JSONArray::setFloat()
  • JSONArray::setBoolean()
Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.