get_text_before_offset


Description:

public TextRange get_text_before_offset (int offset, TextBoundaryType type) throws Error

Gets delimited text from an Text object which precedes a given text offset.

Parameters:

this

a pointer to the Text object on which to operate.

offset

a int indicating the offset from which the delimiter search is based.

type

an TextBoundaryType indicating whether the desired text string is a word, sentence, line, or attribute run.

Returns:

an TextRange containing a UTF-8 string representing the delimited text, both of whose delimiting boundaries are before the current offset, or an empty string if no such text exists.