Scala Library Documentation
|
|
scala/runtime/RichString.scala
]
final
class
RichString(val
self : java.lang.String)
extends
Proxy with
RandomAccessSeq[Char] with
Ordered[java.lang.String]Method Summary | |
override def
|
++
[B >: Char](that : Iterable[B]) : RandomAccessSeq[B]
Appends two iterable objects.
|
override def
|
apply (n : Int) : Char |
def
|
capitalize
: java.lang.String
Returns this string with first character converted to upper case
|
override def
|
compare
(other : java.lang.String) : Int
Result of comparing
this with operand that .
returns x where
x < 0 iff this < that
x == 0 iff this == that
x > 0 iff this > that |
override def
|
containsSlice
[B](that : Seq[B]) : Boolean
Is
that a slice in this? |
override def
|
drop
(from : Int) : RichString
Returns this sequence without its
n first elements
If this sequence has less than n elements, the empty
sequence is returned. (non-strict) |
override def
|
endsWith [B](that : Seq[B]) : Boolean |
override def
|
indexOf [B](that : Seq[B]) : Int |
override def
|
length
: Int
Returns the length of the sequence.
|
def
|
lines
: Iterator[java.lang.String]
Return all lines in this string in an iterator, excluding trailing line
end characters, i.e. apply
.stripLineEnd to all lines
returned by linesWithSeparators . |
def
|
linesWithSeparators
: Iterator[java.lang.String]
Return all lines in this string in an iterator, including trailing line end characters. The number of strings returned is one greater than the number of line end characters in this string. For an empty string, a single empty line is returned. A line end character is one of
|
override def
|
mkString
: java.lang.String
Converts a collection into a flat
String by each element's toString method. |
override def
|
slice
(from : Int, until : Int) : RichString
A sub-sequence of
len elements
starting at index from (non-strict) |
def
|
split (separator : Char) : Array[java.lang.String] |
def
|
split (separators : Array[Char]) : Array[java.lang.String] |
override def
|
startsWith [B](that : Seq[B]) : Boolean |
def
|
stripLineEnd
: java.lang.String
Strip trailing line end character from this string if it has one. A line end character is one of
If a line feed character LF is preceded by a carriage return CR (0x0D hex), the CR character is also stripped (Windows convention). |
def
|
stripMargin
: java.lang.String
For every line in this string:
Strip a leading prefix consisting of blanks or control characters
followed by |
def
|
stripMargin
(marginChar : Char) : java.lang.String
For every line in this string:
Strip a leading prefix consisting of blanks or control characters
followed by |
override def
|
take
(until : Int) : RichString
Returns a sequence consisting only over the first
n
elements of this sequence, or else the whole sequence, if it has less
than n elements. (non-strict) |
def
|
toByte : Byte |
def
|
toDouble : Double |
def
|
toFloat : Float |
def
|
toInt : Int |
def
|
toLong : Long |
def
|
toShort : Short |
override def
|
toString : java.lang.String |
Methods inherited from Ordered | |
<, >, <=, >=, compareTo |
Methods inherited from RandomAccessSeq | |
projection, elements, reverse, patch, toStream, safeIs |
Methods inherited from Seq | |
lengthCompare, size, isEmpty, concat, last, lastOption, headOption, isDefinedAt, lastIndexOf, map, flatMap, filter, takeWhile, dropWhile, contains, subseq, toArray, equalsWith |
Methods inherited from Collection | |
stringPrefix |
Methods inherited from Iterable | |
partition, foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, mkString, mkString, addString, addString, copyToArray, hasDefiniteSize |
Methods inherited from PartialFunction | |
orElse, andThen |
Methods inherited from Function1 | |
compose |
Methods inherited from Proxy | |
hashCode, equals |
Methods inherited from AnyRef | |
getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Method Details |
override
def
length : Int
override
def
toString : java.lang.String
override
def
mkString : java.lang.String
String
by each element's toString method.override
def
slice(from : Int, until : Int) : RichString
len
elements
starting at index from
(non-strict)from -
The index of the first element of the sliceuntil -
The index of the element following the sliceIndexOutOfBoundsException -
if from < 0
or length < from + len
override
def
++[B >: Char](that : Iterable[B]) : RandomAccessSeq[B]
override
def
take(until : Int) : RichString
n
elements of this sequence, or else the whole sequence, if it has less
than n
elements. (non-strict)n -
the number of elements to takeoverride
def
drop(from : Int) : RichString
n
first elements
If this sequence has less than n
elements, the empty
sequence is returned. (non-strict)n -
the number of elements to dropthat
not contained in this, otherwise the index where that
is containedthat
a slice in this?override
def
compare(other : java.lang.String) : Int
this
with operand that
.
returns x
where
x < 0
iff this < that
x == 0
iff this == that
x > 0
iff this > that
def
stripLineEnd : java.lang.String
Strip trailing line end character from this string if it has one. A line end character is one of
If a line feed character LF is preceded by a carriage return CR (0x0D hex), the CR character is also stripped (Windows convention).
def
linesWithSeparators : Iterator[java.lang.String]
Return all lines in this string in an iterator, including trailing line end characters.
The number of strings returned is one greater than the number of line end characters in this string. For an empty string, a single empty line is returned. A line end character is one of
def
lines : Iterator[java.lang.String]
.stripLineEnd
to all lines
returned by linesWithSeparators
.
def
capitalize : java.lang.String
def
stripMargin(marginChar : Char) : java.lang.String
For every line in this string:
Strip a leading prefix consisting of blanks or control characters
followed by marginChar
from the line.
def
stripMargin : java.lang.String
For every line in this string:
Strip a leading prefix consisting of blanks or control characters
followed by |
from the line.
def
split(separator : Char) : Array[java.lang.String]
def
split(separators : Array[Char]) : Array[java.lang.String]
def
toByte : Byte
def
toShort : Short
def
toInt : Int
def
toLong : Long
def
toFloat : Float
def
toDouble : Double
Scala Library Documentation
|
|