コード例 #1
0
 /**
  * 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);
 }
コード例 #2
0
ファイル: StringsTest.php プロジェクト: PaulAntunes/gclf-paul
 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]));
     }
 }