Repository navigation
v0.2.0
Random access to grapheme boundaries, iteration in both directions, and take and drop by graphemes. A position is a UTF-8 byte index, as in copyInto, and a count is a number of graphemes, as length is.
isGraphemeBoundary,nextGraphemeBoundaryandpreviousGraphemeBoundaryanswer at any byte index, without reading the text from its start.iterator(index)starts at the grapheme that contains the byte atindex.GraphemeIteratorhasindex,hasPrevious()andprevious(), andskipNext()andskipPrevious()move without creating aGrapheme.take,drop,takeLastanddropLastcount graphemes, so they never split a flag or an emoji with a skin tone, asString.takecan.
Your code may need a change in 2 cases: a reference such as text::iterator needs an expected type now that iterator has an overload, and the new members win over your own extensions with the same name and parameters, such as Utf8String.take(Int). The compiler plugin did not change.
implementation("io.github.dmitrynekrasov:utf8-string:0.2.0")API reference: https://dmitrynekrasov.github.io/utf8-string/