Package: groovy.lang

## Class GString

- - ### Methods Summary

    Methods
    Return type | Name and parameters
    --- | ---
    `Object` | `asType(Class c)` Converts the GString to a File, or delegates to the default DefaultGroovyMethods#asType(Object, Class)
    `String` | `drop(int num)` A GString variant of the equivalent CharSequence method.
    `String` | `dropWhile(Closure condition)` A GString variant of the equivalent CharSequence method.
    `String` | `getAt(IntRange range)` Support the range subscript operator for GString with IntRange
    `String` | `getAt(Range range)` Support the range subscript operator for GString
    `String` | `getAt(int index)` Support the subscript operator for GString.
    `String` | `take(int num)` A GString variant of the equivalent CharSequence method.
    `String` | `takeWhile(Closure condition)` A GString variant of the equivalent GString method.

  - #### Methods inherited from class java.lang.Object

    `addShutdownHook`, `any`, `any`, `asBoolean`, `asType`, `collect`, `collect`, `collect`, `contains`, `count`, `dump`, `each`, `eachWithIndex`, `equals`, `every`, `every`, `find`, `find`, `findAll`, `findAll`, `findIndexOf`, `findIndexOf`, `findIndexValues`, `findIndexValues`, `findLastIndexOf`, `findLastIndexOf`, `findResult`, `findResult`, `flatten`, `getAt`, `getMetaClass`, `getMetaPropertyValues`, `getProperties`, `grep`, `grep`, `groupBy`, `groupBy`, `hasProperty`, `identity`, `inject`, `inject`, `inspect`, `invokeMethod`, `is`, `isCase`, `iterator`, `join`, `metaClass`, `print`, `print`, `printf`, `printf`, `println`, `println`, `println`, `putAt`, `respondsTo`, `respondsTo`, `setMetaClass`, `size`, `split`, `sprintf`, `sprintf`, `sum`, `sum`, `sum`, `sum`, `toArrayString`, `toSpreadMap`, `toString`, `use`, `use`, `use`, `with`, `withTraits`

  - #### Methods inherited from interface java.lang.CharSequence

    `asBoolean`, `asType`, `bitwiseNegate`, `capitalize`, `center`, `center`, `contains`, `count`, `denormalize`, `drop`, `dropWhile`, `eachLine`, `eachLine`, `eachMatch`, `eachMatch`, `endsWithAny`, `expand`, `expand`, `expandLine`, `find`, `find`, `find`, `find`, `findAll`, `findAll`, `findAll`, `findAll`, `getAt`, `getAt`, `getAt`, `getAt`, `getAt`, `getChars`, `isAllWhitespace`, `isBigDecimal`, `isBigInteger`, `isCase`, `isDouble`, `isFloat`, `isInteger`, `isLong`, `isNumber`, `leftShift`, `matches`, `minus`, `minus`, `multiply`, `next`, `normalize`, `padLeft`, `padLeft`, `padRight`, `padRight`, `plus`, `previous`, `readLines`, `replaceAll`, `replaceAll`, `replaceAll`, `replaceAll`, `replaceFirst`, `replaceFirst`, `replaceFirst`, `replaceFirst`, `reverse`, `size`, `split`, `splitEachLine`, `splitEachLine`, `startsWithAny`, `stripIndent`, `stripIndent`, `stripMargin`, `stripMargin`, `stripMargin`, `take`, `takeWhile`, `toBigDecimal`, `toBigInteger`, `toDouble`, `toFloat`, `toInteger`, `toList`, `toLong`, `toSet`, `toShort`, `toURI`, `toURL`, `tokenize`, `tokenize`, `tokenize`, `tr`, `uncapitalize`, `unexpand`, `unexpand`, `unexpandLine`

  - #### Methods inherited from interface java.lang.Comparable

    `numberAwareCompareTo`

- - ### Methods Detail

    - #### public Object asType(Class c)

      Converts the GString to a File, or delegates to the default DefaultGroovyMethods#asType(Object, Class)

      Parameters:
        `c` - the desired class
      Returns:
        the converted object
      Since:
        1.5.0

    - #### public String drop(int num)

      A GString variant of the equivalent CharSequence method.

      Parameters:
        `num` - the number of characters to drop from this iterator
      Returns:
        a String consisting of all characters except the first `num` ones, or else an empty String, if the toString() of this GString has less than `num` characters.
      Since:
        2.3.7
      See Also:
        CharSequence#drop(int)

    - #### public String dropWhile(Closure condition)

      A GString variant of the equivalent CharSequence method.

      Parameters:
        `condition` - the closure that while continuously evaluating to true will cause us to drop elements from the front of the original GString
      Returns:
        the shortest suffix of the given GString such that the given closure condition evaluates to true for each element dropped from the front of the CharSequence
      Since:
        2.3.7
      See Also:
        CharSequence#dropWhile(groovy.lang.Closure)

    - #### public String getAt(IntRange range)

      Support the range subscript operator for GString with IntRange

      Parameters:
        `range` - an IntRange
      Returns:
        the String of characters corresponding to the provided range
      Since:
        2.3.7

    - #### public String getAt(Range range)

      Support the range subscript operator for GString

      Parameters:
        `range` - a Range
      Returns:
        the String of characters corresponding to the provided range
      Since:
        2.3.7

    - #### public String getAt(int index)

      Support the subscript operator for GString.

      Parameters:
        `index` - the index of the Character to get
      Returns:
        the Character at the given index
      Since:
        2.3.7

    - #### public String take(int num)

      A GString variant of the equivalent CharSequence method.

      Parameters:
        `num` - the number of chars to take from this GString
      Returns:
        a String consisting of the first `num` chars, or else the whole GString if it has less then `num` elements.
      Since:
        2.3.7

    - #### public String takeWhile(Closure condition)

      A GString variant of the equivalent GString method.

      Parameters:
        `condition` - the closure that must evaluate to true to continue taking elements
      Returns:
        a prefix of elements in the GString where each element passed to the given closure evaluates to true
      Since:
        2.3.7