File: ../../Developer.FoundationDotJS.org/wwwroot/Foundation.js

Foundation
Class StringBuilder

Object
  
 
 
Foundation.StringBuilder

All Implemented Interfaces:

Class


Foundation.StringBuilder

implements Foundation.Class

A class to build strings efficiently and quickly. See the Foundation.StringBuilder home page for more information.

Example:

var builder=new Foundation.StringBuilder();
builder.append("hello");
builder.append(" ");
builder.append("world");
alert(builder.toString());

Constructor Summary
Foundation.StringBuilder(/*Number*/ initialSize)

Method Summary
[this]append(/*String*/ value)
Appends data to the string builder.
[this]clear()
Clears all data from the string builder.
 dispose()
StringtoString()
Concatenates all values added by the append method.

Methods inherited from Foundation.Class
getTypePath, isInstanceOf

Constructor Detail

StringBuilder

Foundation.StringBuilder(/*Number*/ initialSize)
Parameters:
initialSize - 
(Optional) Initial size of internal array (defaults to 1000). Should be just over the number of times the append method will be called (but do not sweat it, it is auto adjusting).

Method Detail

append

[this] append(/*String*/ value)

Appends data to the string builder.

Parameters:
value - 
Value to be appended to the output string.
Returns:
The string builder (this).

clear

[this] clear()

Clears all data from the string builder.

Returns:
The string builder (this).

dispose

dispose()
Overrides:
dispose in class Class

toString

String toString()

Concatenates all values added by the append method.

Overrides:
toString in class Class
Returns:
The string.