InternalEncoding provides primitive API to deal with strings across all platforms. You should consider adopting Unifill before this.

Static variables

staticread onlyinternalEncoding:String

Returns Encoding strings on the platform are encoded in.

Static methods

staticinline backwardOffsetByCodePoints (s:String, index:Int, codePointOffset:Int):Int

Returns the index within String s that is offset from position index by codePointOffset code points counting backward.

staticinline charAt (s:String, index:Int):String

Returns the character as a String at position index of String s.

staticinline codePointAt (s:String, index:Int):Int

Returns the Unicode code point at position index of String s.

staticinline codePointCount (s:String, beginIndex:Int, endIndex:Int):Int

Returns the number of Unicode code points from beginIndex to endIndex in String s.

staticinline codePointWidthAt (s:String, index:Int):Int

Returns the number of units of the code point at position index of String s.

staticinline codePointWidthBefore (s:String, index:Int):Int

Returns the number of units of the code point before position index of String s.

staticinline codeUnitAt (s:String, index:Int):Int

Returns the UTF-8/16/32 code unit at position index of String s.

staticinline encodeWith (f:Int ‑> Void, c:Int):Void

staticinline fromCodePoint (codePoint:Int):String

Converts the code point code to a character as String.

staticinline fromCodePoints (codePoints:Iterable<Int>):String

Converts codePoints to a String.

staticisValidString (s:String):Bool

Returns if String s is valid.

staticinline offsetByCodePoints (s:String, index:Int, codePointOffset:Int):Int

Returns the index within String s that is offset from position index by codePointOffset code points.

staticinline validate (s:String):Void

Validates String s.

If the code unit sequence of s is invalid, Exception.InvalidCodeUnitSequence is throwed.