Package: java.lang

## [Java] Class StringBuilder

- java.lang.StringBuilder

-     public class StringBuilder
      extends Object

  GDK enhancements for StringBuilder.

  displayName:
    StringBuilder
  receiverFqcn:
    java.lang.StringBuilder

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public StringBuilder` | `append(GStringImpl gs)` Append the GString to the StringBuilder using a more efficient approach than Java's default approach for a CharSequence.
    `` | `public int` | `getLength()` Provides a `getLength` alias for `length` for StringBuilder, supporting assignment arithmetic operator expressions involving the otherwise write-only length property.
    `` | `public StringBuilder` | `leftShift(Object value)` Overloads the left shift operator to provide syntactic sugar for appending to a StringBuilder.
    `` | `public StringBuilder` | `leftShift(Object value)` Overloads the left shift operator to provide an easy way to append multiple objects as string representations to a StringBuilder.
    `` | `public String` | `plus(String value)` Appends a String to this StringBuilder.
    `` | `public void` | `putAt(EmptyRange range, Object value)` Supports the range subscript operator for StringBuilder.
    `` | `public void` | `putAt(IntRange range, Object value)` Supports the range subscript operator for StringBuilder.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `addShutdownHook, any, any, asBoolean, asType, 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, tap, toString, use, use, use, with, with, withCloseable, withCloseable, withMethodClosure, withStream, withStream, withTraits`

- - ### Method Detail

    - #### public StringBuilder append(GStringImpl gs)

      Append the GString to the StringBuilder using a more efficient approach than Java's default approach for a CharSequence.

      Parameters:
        `gs` - a GStringImpl
      Returns:
        the StringBuilder
      Since:
        3.0.8

    - #### public int getLength()

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

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

      Returns:
        the length of the StringBuilder
      Since:
        5.0.0

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

      Overloads the left shift operator to provide syntactic sugar for appending to a StringBuilder.

      Parameters:
        `value` - an Object
      Returns:
        the original StringBuilder
      Since:
        1.8.2

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

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

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

    - #### public String plus(String value)

      Appends a String to this StringBuilder.

      Parameters:
        `value` - a String
      Returns:
        a String
      Since:
        1.5.2

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

      Supports the range subscript operator for StringBuilder.

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

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

      Supports the range subscript operator for StringBuilder. Index values are treated as characters within the builder.

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