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

Method replaceFirst

java/com/google/re2j/RE2.java:416–426  ·  view source on GitHub ↗
(String src, final String repl)

Source from the content-addressed store, hash-verified

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

Callers 2

replaceTestHelperMethod · 0.95
testReplaceFirstMethod · 0.45

Calls 1

replaceAllFuncMethod · 0.95

Tested by 2

replaceTestHelperMethod · 0.76
testReplaceFirstMethod · 0.36