/**
 * Cap a string with a single instance of a given value.
 *
 * @param  string $cap Cap
 *
 * @return self Returns instance of The Strings class.
 */
public function finish(string $cap): self

Examples

$result = Strings::create('/movies/sg-1/season-5/episode-21')->finish('/');

var_dump($result);

The above example will output:

/movies/sg-1/season-5/episode-21/

Getting Started

Methods