MCPcopy Create free account
hub / github.com/google/re2j / replaceFirst

Method replaceFirst

java/com/google/re2j/Matcher.java:591–593  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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) {

Callers 1

testReplaceFirstMethod · 0.95

Calls 1

replaceMethod · 0.95

Tested by 1

testReplaceFirstMethod · 0.76