Module jls.lang.StringBuffer

Represents a mutable string.

Class StringBuffer

StringBuffer:new ([...]) Creates a new StringBuffer.
stringBuffer:append (value) Appends the string representation of the value to this buffer.
stringBuffer:delete (i[, j]) Removes a part of this string buffer.
stringBuffer:insert (i, s) Inserts a string to this string buffer at the specified position.
stringBuffer:replace (i, j, s) Replaces a part of this string buffer by the specified string.
stringBuffer:length () Returns the length of this buffer.
stringBuffer:toString () Returns the string representation of this buffer.


Class StringBuffer

A StringBuffer class. The StringBuffer optimizes the addition of strings in a buffer by avoiding the use of intermediary concatenated string.
StringBuffer:new ([...])
Creates a new StringBuffer.

Parameters:

  • ... string The initial values. (optional)
stringBuffer:append (value)
Appends the string representation of the value to this buffer.

Parameters:

  • value the value to append.

Returns:

    jls.lang.StringBuffer this buffer.
stringBuffer:delete (i[, j])
Removes a part of this string buffer.

Parameters:

  • i number the index of the first byte to remove, inclusive.
  • j number the index of the last byte to remove, exclusive. (optional)

Returns:

    jls.lang.StringBuffer this buffer.
stringBuffer:insert (i, s)
Inserts a string to this string buffer at the specified position.

Parameters:

  • i number the index of the byte where the string will be inserted.
  • s string the string to insert.

Returns:

    jls.lang.StringBuffer this buffer.
stringBuffer:replace (i, j, s)
Replaces a part of this string buffer by the specified string.

Parameters:

  • i number the index of the byte where the string will be inserted.
  • j number the index of the last byte to replace, exclusive.
  • s string the string to use as replacement.

Returns:

    jls.lang.StringBuffer this buffer.
stringBuffer:length ()
Returns the length of this buffer.

Returns:

    number the length of this buffer.
stringBuffer:toString ()
Returns the string representation of this buffer.

Returns:

    string the string representation of this buffer.
generated by LDoc 1.4.6 Last updated 2022-01-22 16:32:56