| @@ 132-144 (lines=13) @@ | ||
| 129 | * |
|
| 130 | * @return self |
|
| 131 | */ |
|
| 132 | public function str(string $delimiter): self |
|
| 133 | { |
|
| 134 | $sub = mb_strstr($this->value, $delimiter); |
|
| 135 | ||
| 136 | if ($sub === false) { |
|
| 137 | throw new SubstringException(sprintf( |
|
| 138 | 'Substring "%s" not found', |
|
| 139 | $delimiter |
|
| 140 | )); |
|
| 141 | } |
|
| 142 | ||
| 143 | return new self($sub); |
|
| 144 | } |
|
| 145 | ||
| 146 | /** |
|
| 147 | * Return the string in upper case |
|
| @@ 142-154 (lines=13) @@ | ||
| 139 | * |
|
| 140 | * @return self |
|
| 141 | */ |
|
| 142 | public function str(string $delimiter): self |
|
| 143 | { |
|
| 144 | $sub = mb_strstr($this->value, $delimiter); |
|
| 145 | ||
| 146 | if ($sub === false) { |
|
| 147 | throw new SubstringException(sprintf( |
|
| 148 | 'Substring "%s" not found', |
|
| 149 | $delimiter |
|
| 150 | )); |
|
| 151 | } |
|
| 152 | ||
| 153 | return new self($sub); |
|
| 154 | } |
|
| 155 | ||
| 156 | /** |
|
| 157 | * Return the string in upper case |
|