| @@ 471-480 (lines=10) @@ | ||
| 468 | * |
|
| 469 | * @return self |
|
| 470 | */ |
|
| 471 | public function substring(int $start, int $length = null): self |
|
| 472 | { |
|
| 473 | if ($length === null) { |
|
| 474 | $sub = substr($this->value, $start); |
|
| 475 | } else { |
|
| 476 | $sub = substr($this->value, $start, $length); |
|
| 477 | } |
|
| 478 | ||
| 479 | return new self($sub); |
|
| 480 | } |
|
| 481 | ||
| 482 | /** |
|
| 483 | * Return a formatted string |
|
| @@ 444-453 (lines=10) @@ | ||
| 441 | * |
|
| 442 | * @return self |
|
| 443 | */ |
|
| 444 | public function substring(int $start, int $length = null): self |
|
| 445 | { |
|
| 446 | if ($length === null) { |
|
| 447 | $sub = substr($this->value, $start); |
|
| 448 | } else { |
|
| 449 | $sub = substr($this->value, $start, $length); |
|
| 450 | } |
|
| 451 | ||
| 452 | return new self($sub); |
|
| 453 | } |
|
| 454 | ||
| 455 | /** |
|
| 456 | * Return a formatted string |
|