Package: java.lang

## [Java] Class StringBuffer

- java.lang.StringBuffer

-     public class StringBuffer
      extends Object

  GDK enhancements for StringBuffer.

  displayName:
    StringBuffer
  receiverFqcn:
    java.lang.StringBuffer

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public int` | `getLength()` Provides a `getLength` alias for `length` for StringBuffer, supporting assignment arithmetic operator expressions involving the otherwise write-only length property.
    `` | `public StringBuffer` | `leftShift(Object value)` Overloads the left shift operator to provide an easy way to append multiple objects as string representations to a StringBuffer.
    `` | `public String` | `plus(String right)` Appends a String to this StringBuffer.
    `` | `public void` | `putAt(EmptyRange range, Object value)` Supports the range subscript operator for StringBuffer.
    `` | `public void` | `putAt(IntRange range, Object value)` Supports the range subscript operator for StringBuffer.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `addShutdownHook, any, any, asBoolean, asType, clamp, clamp, collect, collect, collect, dump, each, eachMatch, eachMatch, eachWithIndex, every, every, find, find, findAll, findAll, findIndexOf, findIndexOf, findIndexValues, findIndexValues, findLastIndexOf, findLastIndexOf, findResult, findResult, findResult, findResult, getAt, getMetaClass, getMetaPropertyValues, getProperties, grep, grep, hasProperty, identity, inject, inject, inspect, invokeMethod, is, isCase, isNotCase, iterator, metaClass, print, print, printf, printf, println, println, println, putAt, respondsTo, respondsTo, setMetaClass, sleep, sleep, split, sprintf, sprintf, stream, takeIf, tap, toString, use, use, use, with, with, withCloseable, withCloseable, withMethodClosure, withStream, withStream, withTraits`

- - ### Method Detail

    - #### public int getLength()

      Provides a `getLength` alias for `length` for StringBuffer, supporting assignment arithmetic operator expressions involving the otherwise write-only length property.

           def sb = new StringBuffer()
           sb << 'foobar'
           sb.length -= 3
           assert sb.toString() == 'foo'

      Returns:
        the length of the StringBuffer
      Since:
        5.0.0

    - #### public StringBuffer leftShift(Object value)

      Overloads the left shift operator to provide an easy way to append multiple objects as string representations to a StringBuffer.

      Parameters:
        `value` - a value to append
      Returns:
        the StringBuffer on which this operation was invoked
      Since:
        1.0

    - #### public String plus(String right)

      Appends a String to this StringBuffer.

      Parameters:
        `right` - a String
      Returns:
        a String
      Since:
        1.0

    - #### public void putAt(EmptyRange range, Object value)

      Supports the range subscript operator for StringBuffer.

      Parameters:
        `range` - a Range
        `value` - the object that's toString() will be inserted
      Since:
        1.0

    - #### public void putAt(IntRange range, Object value)

      Supports the range subscript operator for StringBuffer. Index values are treated as characters within the buffer.

      Parameters:
        `range` - a Range
        `value` - the object that's toString() will be inserted
      Since:
        1.0