Unifill provides Unicode-code-point-wise methods on Strings. It is ideally used with 'using Unifill' and then acts as an extension to the String class.

Static methods

staticinline uAddChar (sb:StringBuf, c:CodePoint):Void

Appends the character c to StringBuf sb.

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

Returns the character at position index by code points of String s.

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

Returns the code point as Int at position index by code points of String s.

staticinline uCodePointAt (s:String, index:Int):CodePoint

Returns the code point at position index by code points of String s.

staticuCompare (a:String, b:String):Int

Compares String a and b.

staticinline uIndexOf (s:String, value:String, ?startIndex:Int):Int

Returns the position of the leftmost occurence of the str within String s.

startIndex is counted by code points.

staticinline uIterator (s:String):CodePointIter

Returns an iterator of the code points of String s.

staticinline uLastIndexOf (s:String, value:String, ?startIndex:Int):Int

Returns the position of the rightmost occurence of the str within String s.

startIndex is counted by code points.

staticinline uLength (s:String):Int

Returns the number of Unicode code points of String s.

staticinline uSplit (s:String, delimiter:String):Array<String>

Splits String s at each occurence of delimiter.

staticinline uSubstr (s:String, startIndex:Int, ?length:Int):String

Returns length characters of String s, starting at position startIndex.

startIndex and length are counted by code points.

staticinline uSubstring (s:String, startIndex:Int, ?endIndex:Int):String

Returns the part of String s from startIndex to endIndex.

startIndex and endIndex are counted by code points.

staticinline uToString (codePoints:Iterable<CodePoint>):String

Converts codePoints to string.