Class org.as2lib.data.type.MultilineString

Implemented Interfaces

BasicInterface

Description

MultilineString is a extension for String that allows to access all lines seperatly.

To not have to deal with different forms of line breaks (Windows/Apple/Unix) MultilineString automatically standarizes them to the \n character. So the passed-in string will always get standardized.

If you need to access the orignal string you can use getOriginalString.

Field Index

Inherited from String

length

Method Index

new MultilineString()
getLine(), getLineCount(), getLines(), getOriginalString(), lineIterator(), toString()

Inherited from String

charAt(), charCodeAt(), concat(), endswith(), fromCharCode(), indexOf(), lastIndexOf(), replace(), slice(), split(), substr(), substring(), toLowerCase(), toUpperCase()

Constructor Detail

MultilineString

public function MultilineString(string:String)

Constructs a new MultilineString.

Parameters

string String to be handled as multiline

Method Detail

getOriginalString

public function getOriginalString(Void):String

Returns the original used string (without line break standarisation).

Return

the original used string

getLine

public function getLine(line:Number):String

Returns a specific line within the MultilineString.

It will return undefined if the line does not exist.

The line does not contain the line break.

The counting of lines startes with 0.

Parameters

linenumber of the line to get the content of

Return

content of the line

getLines

public function getLines(Void):Array

Returns the content as array that contains each line.

Return

content split into lines

getLineCount

public function getLineCount(Void):Number

Returns the amount of lines in the content.

Return

amount of lines within the content

lineIterator

public function lineIterator(Void):Iterator

Returns a Iterator to iterate through all lines of the content.

Return

Iterator for all lines of the content

toString

public function toString():String

Extended .toString implementation.

Return

this instance as string

Specified By

toString() in org.as2lib.core.BasicInterface