++ed by:
MHOWARD DMOL ILUX HAMMER KES
10 non-PAUSE users
Author image Yuki Kimoto

Name

SPVM::StringBuffer - String buffer

Synopsys

  use StringBuffer;
  
  # new
  my $buffer = StringBuffer->new;
  
  # push string
  $buffer->push("abc");
  $buffer->push("def");
  
  # Convert to string - abcdef
  my $string = $buffer->to_string;
  

Description

String buffer.

Class Methods

new

  static method new : StringBuffer ()

Create new StringBuffer object.

Instance Methods

value

  method value : mutable string; ()

Get the value of the string buffer.

length

  method length : int ()

Get the string length.

push

  method push  : void ($string : string)

Push a string to the string buffer.

push_char

  method push_char : void ($char : byte)

Push a character to the string buffer.

to_string

  method to_string : string ()

Convert the string buffer to a string.