Class M.StringBuilder
Extends
M.Object.
The string builder is a utility object to join multiple strings to one single string.
Defined in: string_builder.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
An array containing all strings used within this string builder.
|
|
The type of this object.
|
Method Attributes | Method Name and Description |
---|---|
append(value, count)
This method appends the given string, 'value', to its internal list of strings.
|
|
clear()
This method clears the string builders internal string list.
|
|
create(str)
This method creates a new string builder instance.
|
|
toString()
This method returns a single string, consisting of all previously appended strings.
|
Field Detail
{Array}
strings
An array containing all strings used within this string builder.
{String}
type
The type of this object.
Method Detail
{Boolean}
append(value, count)
This method appends the given string, 'value', to its internal list of strings. With
an additional parameter 'count', you can force this method to add the string multiple
times.
- Parameters:
- {String} value
- The value of the string to be added.
- {Number} count
- The number to specify how many times the string will be added.
- Returns:
- {Boolean} The result of this operation: success/YES, error/NO.
clear()
This method clears the string builders internal string list.
create(str)
This method creates a new string builder instance.
- Parameters:
- {String} str
- The initial string for this string builder.
{String}
toString()
This method returns a single string, consisting of all previously appended strings. They
are concatenated in the order they were appended to the string builder.
- Returns:
- {String} The concatenated string of all appended strings.