capitalize

This method capitalizes the first letter of each word in the current payload.

Usage

$string = 'hello world';
$string = SM::capitalize($string);
// or
$string = SM::make($string)
    ->capitalize();
echo $string; // Hello World