This abstract provides consistent cross-target unicode support for characters of any width.

Due to differing internal representations of strings across targets, only the basic multilingual plane (BMP) is supported consistently by String class.

This abstract provides API to consistently handle all characters even beyond BMP.

See also:

Static variables

staticread onlylength:Int

The number of characters in this String.

Static methods

staticcharAt(this:String, index:Int):String

Returns the character at position index of this String.

If index is negative or exceeds this.length, the empty String "" is returned.

staticcharCodeAt(this:String, index:Int):Null<Int>

Returns the character code at position index of this String.

If index is negative or exceeds this.length, null is returned.

staticsubstr(this:String, pos:Int, ?len:Int):String

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.