The goog.string.StringBuffer Class

goog.string.StringBuffer(opt_a1, var_args)

Utility class to facilitate string concatenation.

opt_a1 {*=}
Optional first initial item to append.
var_args {...*}
Other initial items to append, e.g., new goog.string.StringBuffer('foo', 'bar').

.append(a1, opt_a2, var_args)

Appends one or more items to the buffer. Calling this with null, undefined, or empty arguments is an error.

a1 {*}
Required first string.
opt_a2 {*=}
Optional second string.
var_args {...*}
Other items to append, e.g., sb.append('foo', 'bar', 'baz').
returns {goog.string.StringBuffer}
This same StringBuffer object.
@suppress
{duplicate}

.clear()

Clears the internal buffer.

.getLength()

returns {number}
the length of the current contents of the buffer.

.set(s)

Sets the contents of the string buffer object, replacing what's currently there.

s {*}
String to set.

.toString()

returns {string}
The concatenated string.