src/Text.php
public function substring(int $start, ?int $length = null): Text {
    if($length === null) {
      return new static(substr($this->raw, $start));
    }

    return new static(substr($this->raw, $start, $length));
  }
public function substring(int $start, ?int $length = null): Text {
    if($length === null) {
      return new static(substr($this->raw, $start));
    }

    return new static(substr($this->raw, $start, $length));
  }
Get part of this Text object

@param  int       $start   Where in the string to start
@param  int|null  $length  (optional) The number of characters to get

@return  Text  A new Text object containing part of this Text object