Method: Text.splitText()

Availability

BlackBerry Device Software version 4.6 or later

The splitText() method breaks the node into two nodes at the specified offset location.

Syntax

Text.splitText( offset )

Parameters

Parameter

Type

Description

offset

long

The offset position at which to split the text.

Return values

Returns the second half of the text as a new Text node, which is automatically added to the DOM tree adjacent to the original Text node.

Exceptions

Exception

Description

INDEX_SIZE_ERR

This error is thrown if offset is negative, or is greater than the number of 16-bit units in the data.

NO_MODIFICATION_ALLOWED_ERR

This error is thrown if the Node is read only.


Was this information helpful? Send us your comments.