klyn.io.xml.dom.XMLCharacterData.replaceData
method
public replaceData(offset as Int, count as Int, arg as String) as Void throws DOMException:
Description

Replaces a bounded range after validating its offset and count.

Parameters
ParameterDescription
offsetZero-based UTF-16 offset, including length.
countNumber of UTF-16 units to replace, clipped at the end.
argReplacement text; null acts as empty text.
Throws
  • DOMException if the DOM operation violates document ownership, hierarchy, naming, index, or node-state constraints.
Example
text = document.createTextNode("hello")
text.replaceData(1, 100, "i")
assert text.data == "hi"