(String src, final String repl)
| 414 | */ |
| 415 | // This is visible for testing. |
| 416 | String replaceFirst(String src, final String repl) { |
| 417 | return replaceAllFunc( |
| 418 | src, |
| 419 | new ReplaceFunc() { |
| 420 | @Override |
| 421 | public String replace(String orig) { |
| 422 | return repl; |
| 423 | } |
| 424 | }, |
| 425 | 1); |
| 426 | } |
| 427 | |
| 428 | /** |
| 429 | * Returns a copy of {@code src} in which at most {@code maxReplaces} matches for this regexp have |