Ejemplo n.º 1
0
 function test_starts_with()
 {
     $this->assertTrue(Str::starts_with('wpdc', 'wp'));
     $this->assertTrue(wpdevsclub_starts_with('wpdc', 'wpdc'));
     $this->assertTrue(Str::starts_with('wpdc', array('wpd')));
     $this->assertFalse(Str::starts_with('wpdc', 'dc'));
     $this->assertFalse(wpdevsclub_starts_with('wpdc', array('dc')));
     $this->assertFalse(Str::starts_with('wpdc', ''));
 }
Ejemplo n.º 2
0
 /**
  * Determine if a given string starts with a given substring.
  *
  * @param  string  $haystack
  * @param  string|array  $needles
  * @return bool
  */
 function wpdevsclub_starts_with($haystack, $needles)
 {
     return Str::starts_with($haystack, $needles);
 }