示例#1
0
 /**
  * Test that startsWith() returns true if the start of the string matches the needle.
  */
 public function testStartsWith()
 {
     $this->assertTrue(String::startsWith($this->string, 'Titon'));
     $this->assertFalse(String::startsWith($this->string, 'Titan'));
     // case-insensitive
     $this->assertTrue(String::startsWith($this->string, 'TITON', false));
     $this->assertFalse(String::startsWith($this->string, 'TITAN', false));
 }
示例#2
0
 function str_starts_with($string, $needle, $strict = true)
 {
     return String::startsWith($string, $needle, $strict);
 }