Search processing.org:

Reference for Processing version 1.0.1+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

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 a primitive datatype, string, or array to its boolean representation. The number 0 evaluates to false and all other numbers evaluate to true.

Syntax

    boolean(val)

Parameters

val | String, String[]

Returns | boolean
Usage | Web & Application
Related | boolean

Updated on November 22, 2008 08:39:25pm PST