| Extracted from Pike v7.8 release 866 at 2018-02-09.

[Top]
String
String.Buffer

# Class String.Buffer

Description

  A buffer, used for building strings. It's conceptually similar to a string, but you can only add strings to it, and you can only get the value from it once.

  There is a reason for those seemingly rather odd limitations, it makes it possible to do some optimizations that really speed things up.

  You do not need to use this class unless you add very many strings together, or very large strings.

Example

      For the fastest possible operation, write your code like this:

  String.Buffer b = String.Buffer( );

  function add = b->add;

  .. call add several times in code ...

  string result = b->get(); // also clears the buffer