StyledTextContent.getLineAtOffset

Return the line index at the given character offset. <p>

@param offset offset of the line to return. The first character of the document is at offset 0. An offset of getLength() is valid and should answer the number of lines. @return the line index. The first line is at index 0. If the character at offset is a delimiter character, answer the line index of the line that is delimited. For example, if text = "\r\n\r\n", and delimiter = "\r\n", then: <ul> <li>getLineAtOffset(0) is 0 <li>getLineAtOffset(1) is 0 <li>getLineAtOffset(2) is 1 <li>getLineAtOffset(3) is 1 <li>getLineAtOffset(4) is 2 </ul>

interface StyledTextContent
int
getLineAtOffset
(
int offset
)

Meta