haXe API Documentation
Back |
Indexclass String
Available in flash8, neko, js, flash, php, cpp, cs, java
The basic String class.
- var length(default,null) : Int
- The number of characters in the String.
- function new(string : String) : Void
- Creates a copy from a given String.
- function charAt(index : Int) : String
- Returns the character at the given position.
Returns the empty String if outside of String bounds.
- function charCodeAt(index : Int) : Null<Int>
- Returns the character code at the given position.
Returns
null
if outside of String bounds. - function 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. - function lastIndexOf(str : String, ?startIndex : Int) : Int
- Similar to
indexOf
but returns the latest index. - function split(delimiter : String) : Array<String>
- Split the string using the specified delimiter.
- function 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. - function substring(startIndex : Int, ?endIndex : Int) : String
- Returns a part of the String, taking from
startIndex
to endIndex
- 1.
If endIndex
is not specified, length is used.
If startIndex
or endIndex
is smaller than 0, than 0 is used.
If startIndex
> endIndex
then they are swaped. - function toLowerCase() : String
- Returns an String where all characters have been lowercased.
- function toString() : String
- Returns the String itself.
- function toUpperCase() : String
- Returns an String where all characters have been uppercased.
- static function fromCharCode(code : Int) : String
Back |
Index