klyn.io.xml.dom.XMLText.splitText
method
public splitText(offset as Int) as Text throws DOMException:
Description

Splits this Text or CDATA node at a UTF-16 offset.

Parameters
ParameterDescription
offsetUTF-16 boundary; a surrogate pair cannot be split in Klyn.
Returns

The new sibling of the same node type.

Throws
  • DOMException if the DOM operation violates document ownership, hierarchy, naming, index, or node-state constraints.
Example
tail = document.createTextNode("hello").splitText(2)
assert tail.data == "llo"