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

Examples

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

echo $string;

The above example will output:

SG-1 returns from an off-world

Getting Started

Methods