nextBoundary

fun nextBoundary(src: CharSequence, off: Int, limit: Int): Int

Look for the next extended grapheme cluster boundary in a CharSequence. It assumes the start of the char sequence at offset off is a boundary.

See Unicode Standard Annex #29 Unicode Text Segmentation for the specification for the extended grapheme cluster boundary rules. The following implementation is based on the annex for Unicode version 15.1.

Return

the next grapheme boundary

Parameters

src

the CharSequence to be scanned

off

offset to start looking for the next boundary in the src

limit

limit offset in the src (exclusive)