src/Str.php
public function split(string $delimiter = null): StreamInterface
    {
        if (\is_null($delimiter) || $delimiter === '') {
            return $this->chunk();
        }

        $parts = \explode($delimiter, $this->value);
        $stream = new Stream(self::class);

        foreach ($parts as $part) {
            $stream = $stream->add(new self($part, $this->encoding));
        }

        return $stream;
    }
public function split(string $delimiter = null): StreamInterface
    {
        if (\is_null($delimiter) || $delimiter === '') {
            return $this->chunk();
        }

        $parts = \explode($delimiter, $this->value);
        $stream = new Stream(self::class);

        foreach ($parts as $part) {
            $stream = $stream->add(new self($part, $this->encoding));
        }

        return $stream;
    }
public function split ( string $ delimiter = null ) : StreamInterface { if ( \ is_null ( $ delimiter ) || $ delimiter === '' ) { return $ this -> chunk ( ) ; } $ parts = \ explode ( $ delimiter , $ this -> value ) ; $ stream = new Stream ( self :: class ) ; foreach ( $ parts as $ part ) { $ stream = $ stream -> add ( new self ( $ part , $ this -> encoding ) ) ; } return $ stream ; }
Split the string into a collection of ones

@param string $delimiter

@return StreamInterface<self>
Split the string into a collection of ones