Home

# Class goog.string.StringBuffer

Utility class to facilitate much faster string concatenation in IE, using Array.join() rather than the '+' operator. For other browsers we simply use the '+' operator.

Instance Method Summary
| `append((Object|boolean|null|number|string) a1, (Object|boolean|null|number|string=) opt_a2, (Object|boolean|null|number|string|undefined) var_args) ⇒ ?goog.string.StringBuffer` Appends one or more items to the buffer. Calling this with null, undefined, or empty arguments is an error.
| `append((Object|boolean|null|number|string) a1, (Object|boolean|null|number|string=) opt_a2, (Object|boolean|null|number|string|undefined) var_args) ⇒ ?goog.string.StringBuffer` Appends one or more items to the buffer. Calling this with null, undefined, or empty arguments is an error.
| `clear()` Clears the internal buffer.
| `getLength() ⇒ number` Returns the length of the current contents of the buffer. In IE, this is O(n) where n = number of appends, so to avoid quadratic behavior, do not call this after every append.
| `set(string s)` Sets the contents of the string buffer object, replacing what's currently there.
| `toString() ⇒ string` Returns the concatenated string.