search API (or start typing anywhere)
InternalEncoding
mint.core.unifill.InternalEncoding
InternalEncoding provides primitive API to deal with strings across all platforms. You should consider adopting Unifill before this.
class
Methods
backwardOffsetByCodePointsinlinestatic
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.
charAtinlinestatic
charAt(s:String, index:Int) : String
Returns the character as a String at position
index
of
String s
.
codePointAtinlinestatic
codePointAt(s:String, index:Int) : Int
Returns the Unicode code point at position
index
of
String s
.
codePointCountinlinestatic
codePointCount(s:String, beginIndex:Int, endIndex:Int) : Int
Returns the number of Unicode code points from
beginIndex
to endIndex
in String s
.
codePointWidthAtinlinestatic
codePointWidthAt(s:String, index:Int) : Int
Returns the number of units of the code point at position
index
of String s
.
codePointWidthBeforeinlinestatic
codePointWidthBefore(s:String, index:Int) : Int
Returns the number of units of the code point before position
index
of String s
.
codeUnitAtinlinestatic
codeUnitAt(s:String, index:Int) : Int
Returns the UTF-8/16/32 code unit at position
index
of
String s
.
fromCodePointinlinestatic
fromCodePoint(codePoint:Int) : String
Converts the code point
code
to a character as String.
fromCodePointsinlinestatic
fromCodePoints(codePoints:Iterable<Int>) : String
Converts
codePoints
to a String.
isValidStringstatic
isValidString(s:String) : Bool
Returns if String
s
is valid.
offsetByCodePointsinlinestatic
offsetByCodePoints(s:String, index:Int, codePointOffset:Int) : Int
Returns the index within String
s
that is offset from
position index
by codePointOffset
code points.
validateinlinestatic
validate(s:String) : Void
Validates String
s
.
If the code unit sequence of `s` is invalid,
`Exception.InvalidCodeUnitSequence` is throwed.</span>