public class GString
extends Object
GDK enhancements for GString.
| Type Params | Return Type | Name and description |
|---|---|---|
<T> |
public T |
asType(Class<T> c)Converts the GString to a File, or delegates to the default DefaultGroovyMethods.asType. |
|
public String |
drop(int num)A GString variant of the equivalent CharSequence method. |
|
public String |
dropRight(int num)A GString variant of the equivalent CharSequence method CharSequence.dropRight. |
|
public String |
dropWhile(Closure condition)A GString variant of the equivalent CharSequence method. |
|
public String |
getAt(int index)Supports the subscript operator for GString. |
|
public String |
getAt(IntRange range)Supports the range subscript operator for GString with IntRange. |
|
public String |
getAt(Range range)Supports the range subscript operator for GString. |
|
public String |
take(int num)A GString variant of the equivalent CharSequence method. |
|
public String |
takeAfter(CharSequence searchString)A GString variant of the equivalent CharSequence method CharSequence.takeAfter. |
|
public String |
takeBefore(String searchString)A GString variant of the equivalent CharSequence method CharSequence.takeBefore. |
|
public String |
takeBetween(CharSequence from, CharSequence to)A GString variant of the equivalent CharSequence method CharSequence.takeBetween. |
|
public String |
takeBetween(CharSequence enclosure)A GString variant of the equivalent CharSequence method CharSequence.takeBetween. |
|
public String |
takeBetween(CharSequence from, CharSequence to, int occurrence)A GString variant of the equivalent CharSequence method CharSequence.takeBetween. |
|
public String |
takeBetween(CharSequence enclosure, int occurrence)A GString variant of the equivalent CharSequence method CharSequence.takeBetween. |
|
public String |
takeRight(int num)A String variant of the equivalent CharSequence method CharSequence.takeRight. |
|
public String |
takeWhile(Closure condition)A GString variant of the equivalent GString method. |
| 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 |
Converts the GString to a File, or delegates to the default DefaultGroovyMethods.asType.
c - the desired classA GString variant of the equivalent CharSequence method.
num - the number of characters to drop from this GStringnum ones,
or else an empty String, if the toString() of this GString has less than num characters.A GString variant of the equivalent CharSequence method CharSequence.dropRight.
num - number of charactersnum chars and empty of the num is greater than the
length of the CharSequenceA GString variant of the equivalent CharSequence method.
condition - the closure that while continuously evaluating to true will cause us to drop elements from
the front of the original GStringSupports the subscript operator for GString.
index - the index of the Character to getSupports the range subscript operator for GString with IntRange.
range - an IntRangeSupports the range subscript operator for GString.
range - a RangeA GString variant of the equivalent CharSequence method.
num - the number of chars to take from this GStringnum chars,
or else the whole GString if it has less than num elements.A GString variant of the equivalent CharSequence method CharSequence.takeAfter.
searchString - CharSequence that is searched in this CharSequenceA GString variant of the equivalent CharSequence method CharSequence.takeBefore.
searchString - CharSequence that is searched in this CharSequenceA GString variant of the equivalent CharSequence method CharSequence.takeBetween.
from - beginning of searchto - end of searchA GString variant of the equivalent CharSequence method CharSequence.takeBetween.
enclosure - Enclosure CharSequenceenclosure stringsA GString variant of the equivalent CharSequence method CharSequence.takeBetween.
from - beginning of searchto - end of searchoccurrence - nth occurrence that is to be returned. 0 represents first onefrom and to CharSequences and empty if the unavailable inputs are given.A GString variant of the equivalent CharSequence method CharSequence.takeBetween.
enclosure - Enclosure CharSequenceoccurrence - nth occurrence being returnedenclosure stringsA String variant of the equivalent CharSequence method CharSequence.takeRight.
num - the number of chars to take from this GString from the rightnum chars,
or else the whole GString if it has less than num elements.A GString variant of the equivalent GString method.
condition - the closure that must evaluate to true to continue taking elements