This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.
You can install the package via composer:
composer require victoryoalli/laravel-string-macros
Gets the initicals of the words you provide. It defaults to 2 initials.
Str::initials('Victor Yoalli Dominguez'); //default to 2 initials
// VY
Str::initials('Victor Yoalli Dominguez',3);
// VYD
Replaces question mark symbol to the words that you provide.
Str::interpolate('Roses are ? Violets are ?','RED','BLUE');
// Roses are RED Violets are BLUE
Str::interpolate('Roses are ? Violets are ?',['RED','BLUE']);
// Roses are RED Violets are BLUE
Str::interpolate('Roses are ? Violets are ?',...['RED','BLUE']);
// Roses are RED Violets are BLUE
Calculates how many minutes it takes to read the text provided. It accepts HTML too, it will strip tags to make an accurate calculation.
Str::readingMinutes('Roses are RED Violets are BLUE...');
// 1
Str::readingMinutes('Pellentesque purus imperdiet dis duis netus dapibus mattis adipiscing at ultricies, rutrum volutpat quam ex himenaeos consectetur fusce tempus nostra, mollis fermentum ac fringilla donec lobortis potenti eros pharetra...');
// 1
Str::stripTags('<strong>Hello</strong> <i>World!</i>');
// Hello World!
Str::wordsCount('Hac non ipsum dolor nisi penatibus maecenas luctus purus rutrum, commodo leo sed ut lacinia gravida primis aliquet eget finibus, consequat sapien platea urna vehicula adipiscing est tortor.');
// 28
Example
$str = Str::of('Hac non ? dolor nisi penatibus maecenas luctus purus rutrum, ? leo sed ut lacinia gravida primis aliquet eget finibus, consequat sapien platea urna vehicula adipiscing est tortor.')->interpolate(['RED','BLUE'])->initials(28)->upper();
echo $str;
// HNRDNPMLPRBLSULGPAEFCSPUVAET
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.