src/CharacterData.php
/**
     * Returns a portion of the nodes data string starting at the specified
     * offset.
     *
     * @see https://dom.spec.whatwg.org/#concept-CD-substring
     *
     * @throws \Rowbot\DOM\Exception\IndexSizeError If the given offset is greater than the length of the data.
     */
Returns a portion of the nodes data string starting at the specified
offset.



@throws \Rowbot\DOM\Exception\IndexSizeError If the given offset is greater than the length of the data.
Returns a portion of the nodes data string starting at the specified offset . @throws \ Rowbot \ DOM \ Exception \ IndexSizeError If the given offset is greater than the length of the data .
public function substringData(int $offset, int $count): string
    {
        $length = $this->getLength();
        $offset = Utils::unsignedLong($offset);
        $count = Utils::unsignedLong($count);
        if ($offset < 0 || $offset > $length) {
            throw new IndexSizeError(sprintf(
                'The offset should be less than the length of the data. The'
                . 'offset given is %d and the length of the data is %d.',
                $offset,
                $length
            ));
        }
        if ($offset + $count > $length) {
            return mb_substr($this->data, $offset, null, 'utf-8');
        }
        return mb_substr($this->data, $offset, $count, 'utf-8');
    }
public function substringData ( int $ offset , int $ count ) : string { $ length = $ this -> getLength ( ) ; $ offset = Utils :: unsignedLong ( $ offset ) ; $ count = Utils :: unsignedLong ( $ count ) ; if ( $ offset < 0 || $ offset > $ length ) { throw new IndexSizeError ( sprintf ( 'The offset should be less than the length of the data. The' . 'offset given is %d and the length of the data is %d.' , $ offset , $ length ) ) ; } if ( $ offset + $ count > $ length ) { return mb_substr ( $ this -> data , $ offset , null , 'utf-8' ) ; } return mb_substr ( $ this -> data , $ offset , $ count , 'utf-8' ) ; }
Returns a portion of the nodes data string starting at the specified
 offset.
Returns a portion of the nodes data string starting at the specified offset .