public function toWords(string $string): string
    {
        $words = \trim(\str_replace(['-', '_'], ' ', $string));

        return \ucwords($words);
    }
public function toWords(string $string): string
    {
        $words = \trim(\str_replace(['-', '_'], ' ', $string));

        return \ucwords($words);
    }
public function toWords ( string $ string ) : string { $ words = \ trim ( \ str_replace ( [ '-' , '_' ] , ' ' , $ string ) ) ; return \ ucwords ( $ words ) ; }
Convert a string to capitalized words.

@param string $string

@return string
Convert a string to capitalized words .