Programmer's Guide > Interfaces > W3C CharacterData interface > substringData method
  
substringData method
Extracts a range of data from the node.
substringData(offset, count)
Parameters
unsigned longoffset
Start offset of substring to extract.
unsigned longcount
The number of 16-bit units to extract.
Returns
String. The specified substring. If the sum of offset and count exceeds the length, then all 16-bit units to the end of the data are returned.
Throws
DOMException
INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit units in data, or if the specified count is negative.
DOMSTRING_SIZE_ERR: Raised if the specified range of text does not fit into a DOMString.