UnicodeString(String)
Available on all platforms
This abstract provides consistent cross-target unicode support.
See also:
Static methods
staticvalidate(b:Bytes, encoding:Encoding):Bool
Tells if b is a correctly encoded UTF8 byte sequence.
Variables
read onlylength:Int
Available on cs, js, cpp, java, hl, flash
The number of characters in this String.
Methods
charAt(index:Int):String
Available on cs, js, cpp, java, hl, flash
Returns the character at position index of this String.
If index is negative or exceeds this.length, the empty String "" is returned.
charCodeAt(index:Int):Null<Int>
Available on cs, js, cpp, java, hl, flash
Returns the character code at position index of this String.
If index is negative or exceeds this.length, null is returned.
indexOf(str:String, ?startIndex:Int):Int
Available on cs, js, cpp, java, hl, flash
Returns the position of the leftmost occurrence of str within this String.
If startIndex is given, the search is performed within the substring of this String starting from startIndex (if startIndex is posivite or 0) or max(this.length + startIndex, 0) (if startIndex is negative).
If startIndex exceeds this.length, -1 is returned.
Otherwise the search is performed within this String. In either case, the returned position is relative to the beginning of this String.
If str cannot be found, -1 is returned.
inlineiterator():StringIteratorUnicode
Available on cs, php, js, cpp, macro, java, lua, python, hl, flash
Returns an iterator of the unicode code points.
inlinekeyValueIterator():StringKeyValueIteratorUnicode
Available on cs, php, js, cpp, macro, java, lua, python, hl, flash
Returns an iterator of the code point indices and unicode code points.
lastIndexOf(str:String, ?startIndex:Int):Int
Available on cs, js, cpp, java, hl, flash
Returns the position of the rightmost occurrence of str within this String.
If startIndex is given, the search is performed within the substring of this String from 0 to startIndex + str.length. Otherwise the search is performed within this String. In either case, the returned position is relative to the beginning of this String.
If str cannot be found, -1 is returned.
substr(pos:Int, ?len:Int):String
Available on cs, js, cpp, java, hl, flash
Returns len characters of this String, starting at position pos.
If len is omitted, all characters from position pos to the end of this String are included.
If pos is negative, its value is calculated from the end of this String by this.length + pos. If this yields a negative value, 0 is used instead.
If the calculated position + len exceeds this.length, the characters from that position to the end of this String are returned.
If len is negative, the result is unspecified.
substring(startIndex:Int, ?endIndex:Int):String
Available on cs, js, cpp, java, hl, flash
Returns the part of this String from startIndex to but not including endIndex.
If startIndex or endIndex are negative, 0 is used instead.
If startIndex exceeds endIndex, they are swapped.
If the (possibly swapped) endIndex is omitted or exceeds this.length, this.length is used instead.
If the (possibly swapped) startIndex exceeds this.length, the empty String "" is returned.
© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/UnicodeString.html