- Processing
- p5.js
- Processing.py

- Processing Foundation

This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Javadoc.

Name | ### boolean()
Examples |
    String s = "true";
    boolean b = boolean(s);
    if (b) {
      println("The boolean is true");
    } else {
      println("The boolean is false");
    }
Description | Converts an int or String to its boolean representation. For an int, any non-zero value (positive or negative) evaluates to true, while zero evaluates to false. For a String, the value "true" evaluates to true, while any other value (including "false" or "hippopotamus") evaluates to false. When an array of int or String values is passed in, then a boolean array of the same length is returned.

Updated on June 20, 2015 10:37:41pm UTC