Returns the input with the first match replaced by replacement, interpreted as for appendReplacement. @param replacement the replacement string @return the input string with the first match replaced @throws IndexOutOfBoundsException if replacement refers to an invalid group
(String replacement)
| 589 | * @throws IndexOutOfBoundsException if replacement refers to an invalid group |
| 590 | */ |
| 591 | public String replaceFirst(String replacement) { |
| 592 | return replace(replacement, false); |
| 593 | } |
| 594 | |
| 595 | /** Helper: replaceAll/replaceFirst hybrid. */ |
| 596 | private String replace(String replacement, boolean all) { |