substringData

fun substringData(offset: Int, count: Int): String(source)

The substringData() method of the CharacterData interface returns a portion of the existing data, starting at the specified index and extending for a given number of characters afterwards.

MDN Reference