greenhouse
a creative coding toolkit for spatial interfaces

Str

g-speak’s string class. A utility class to manage a sequence of unicode characters.

The Full Reference and Header provide the best documentation for this class.

  • Compose ()
  • Number ()
  • Length ()
  • IsEmpty ()

Example

#define WORKER
#include "Greenhouse.h"

void Setup ()
{ // Set the string to "3.14"
  Str PiMyDear = Compose ("%f", PI);
  INFORM ("PiMyDear length = " + ToStr (PiMyDear . Length ()));

  // Convert the string back to a float and print it
  float64 pi_the_number = Number (PiMyDear);
  INFORM ("pi = " + ToStr (pi_the_number));

  Text *t = new Text ();
  if (t -> String () . IsEmpty ())
    WARN ("t needs text . . . badly!");
}