substring() публичный Метод

This implementation follows the JavaScript specification for "substring". Examples:: String.substring('Hello, World!', 7, 12) == 'World' String.substring('Hello, World!', 7) == 'World!'
public substring ( string $string, integer $start, integer $end = null ) : string
$string string
$start integer Start index
$end integer End index
Результат string The substring
 /**
  * @test
  * @dataProvider substringExamples
  */
 public function substringWorks($string, $start, $end, $expected)
 {
     $helper = new StringHelper();
     $result = $helper->substring($string, $start, $end);
     $this->assertSame($expected, $result);
 }