/** * Strip off a specific string from the start of another, if an exact match * is not found, the original string (haystack) will be returned * * @param $haystack * @param $needle * * @return string * * @deprecated */ function strip_start($haystack, $needle) { return \Packaged\Helpers\Strings::ltrim($haystack, $needle); }
public function testStripStart() { $expectations = [['Strings', "Strings", ""], ['Strings', "Stri", "ngs"], ['Apple', "Pear", "Apple"]]; foreach ($expectations as $expect) { $this->assertEquals($expect[2], Strings::ltrim($expect[0], $expect[1])); } }