preceding

open fun preceding(offset: Int): Int

Returns the last boundary preceding the specified character offset. If the specified offset is equal to the first text boundary, it returns BreakIterator.DONE and the iterator's current position is unchanged. Otherwise, the iterator's current position is set to the returned boundary. The value returned is always less than the offset or the value BreakIterator.DONE.

Return

The last boundary before the specified offset or BreakIterator.DONE if the first text boundary is passed in as the offset.

Since

1.2

Parameters

offset

the character offset to begin scanning.

Throws

if the specified offset is less than the first text boundary or greater than the last text boundary.