in scala.runtime
class RichString

final class RichString
extends java.lang.Object
with scala.ScalaObject

Constructor Summary
def this (s: java.lang.String)



Def Summary
def apply (index: scala.Int) : scala.Char
Treat string as a function that maps indices to characters.
def lines : scala.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 : java.lang.Object with scala.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

  • LF - line feed (0x0A hex)
  • FF - form feed (0x0C hex)

def stripLineEnd : java.lang.String

Strip trailing line end character from this string if it has one. A line end character is one of

  • LF - line feed (0x0A hex)
  • FF - form feed (0x0C hex)

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 (marginChar: scala.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.



Constructor Detail
def this (s: java.lang.String)

Def Detail
def apply (index: scala.Int): scala.Char
Treat string as a function that maps indices to characters.
Parameters:
index - ...
Returns:
the character at position index.

def lines : scala.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 : java.lang.Object with scala.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

  • LF - line feed (0x0A hex)
  • FF - form feed (0x0C hex)

def stripLineEnd : java.lang.String

Strip trailing line end character from this string if it has one. A line end character is one of

  • LF - line feed (0x0A hex)
  • FF - form feed (0x0C hex)

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 (marginChar: scala.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.