String

type
class
The basic String class.

Static Methods

fromCharCode(code : Int) : String

Constructor

new(string : String)
Creates a copy from a given String.

Instance Variables

length(default,null) : Int

The number of characters in the String.

Instance Methods

charAt(index : Int) : String

Returns the character at the given position. Returns the empty String if outside of String bounds.

charCodeAt(index : Int) : Null<Int>

Returns the character code at the given position. Returns null if outside of String bounds.

indexOf(str : String, ?startIndex : Int) : Int

Returns the index of first occurence of value Returns 1-1 if value is not found. The optional startIndex parameter allows you to specify at which character to start searching. The position returned is still relative to the beginning of the string.

lastIndexOf(str : String, ?startIndex : Int) : Int

Similar to indexOf but returns the latest index.

split(delimiter : String) : Array<String>

Split the string using the specified delimiter.

substr(pos : Int, ?len : Int) : String

Returns a part of the String, taking len characters starting from pos. If len is not specified, it takes all the remaining characters.

toLowerCase() : String

Returns an String where all characters have been lowercased.

toString() : String

Returns the String itself.

toUpperCase() : String

Returns an String where all characters have been uppercased.