src/Str.php
public function words(string $charlist = ''): MapInterface
    {
        $words = \str_word_count($this->value, 2, $charlist);
        $map = new Map('int', self::class);

        foreach ($words as $position => $word) {
            $map = $map->put($position, new self($word, $this->encoding));
        }

        return $map;
    }
public function words(string $charlist = ''): MapInterface
    {
        $words = \str_word_count($this->value, 2, $charlist);
        $map = new Map('int', self::class);

        foreach ($words as $position => $word) {
            $map = $map->put($position, new self($word, $this->encoding));
        }

        return $map;
    }
public function words ( string $ charlist = '' ) : MapInterface { $ words = \ str_word_count ( $ this -> value , 2 , $ charlist ) ; $ map = new Map ( 'int' , self :: class ) ; foreach ( $ words as $ position => $ word ) { $ map = $ map -> put ( $ position , new self ( $ word , $ this -> encoding ) ) ; } return $ map ; }
Return the collection of words

@param string $charlist

@return MapInterface<int, self>
Return the collection of words