/**
 * Get the portion of a string before the last occurrence of a given value.
 *
 * @param string $search Search
 *
 * @return self Returns instance of The Strings class.
 */
public function beforeLast(string $search): self

Examples

$string = Strings::create('SG-1 returns from an off-world mission')->beforeLast('mission');

echo $string;

The above example will output:

SG-1 returns from an off-world

Getting Started

Methods