Str::finish

Posted on November 25, 2016

The Str::finish function adds a single instance of the given value to a string.

If the cap already exists then nothing happens and the initial string is returned.

Example usage

$string = Str::finish('this/string', '/');
// this/string/

$string = Str::finish('Lolita Framework is really awesome', ' and superb');
// Lolita Framework is really awesome and superb

$string = Str::finish('http://home/', '/');
// http://home/

Parameters

string $value

string $cap

Return Value

string

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *