|
Groovy JDK | |||||||||
| Method Summary | |
|---|---|
boolean
|
asBoolean()
Coerce a string (an instance of CharSequence) to a boolean value. |
CharSequence
|
drop(int num)
Drops the given number of chars from the head of this CharSequence if they are available. |
CharSequence
|
getAt(int index)
Support the subscript operator for CharSequence. |
CharSequence
|
getAt(Range range)
Support the range subscript operator for CharSequence |
CharSequence
|
getAt(IntRange range)
Support the range subscript operator for CharSequence or StringBuffer with IntRange |
CharSequence
|
getAt(EmptyRange range)
Support the range subscript operator for CharSequence or StringBuffer with EmptyRange |
CharSequence
|
getAt(Collection indices)
Select a List of characters from a CharSequence using a Collection to identify the indices to be selected. |
CharSequence
|
take(int num)
Returns the first num elements from this CharSequence.
|
| Method Detail |
|---|
public boolean asBoolean()
public CharSequence drop(int num)
def text = "Groovy"
assert text.drop( 0 ) == 'Groovy'
assert text.drop( 2 ) == 'oovy'
assert text.drop( 7 ) == ''
num - the number of characters to drop from this iterator.num ones,
or else an empty String, if this CharSequence has less than num characters.public CharSequence getAt(int index)
index - the index of the Character to get.public CharSequence getAt(Range range)
range - a Range.public CharSequence getAt(IntRange range)
range - an IntRange.public CharSequence getAt(EmptyRange range)
range - an EmptyRange.public CharSequence getAt(Collection indices)
indices - a Collection of indices.public CharSequence take(int num)
num elements from this CharSequence.
def text = "Groovy"
assert text.take( 0 ) == ''
assert text.take( 2 ) == 'Gr'
assert text.take( 7 ) == 'Groovy'
num - the number of chars to take from this CharSequence.num chars,
or else the whole CharSequence if it has less then num elements.
|
Groovy JDK | |||||||||