MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / replacePrefix

Method replacePrefix

src/main/java/net/optifine/util/StrUtils.java:566–589  ·  view source on GitHub ↗
(String str, String prefix, String prefixNew)

Source from the content-addressed store, hash-verified

564 }
565
566 public static String replacePrefix(String str, String prefix, String prefixNew)
567 {
568 if (str != null && prefix != null)
569 {
570 if (!str.startsWith(prefix))
571 {
572 return str;
573 }
574 else
575 {
576 if (prefixNew == null)
577 {
578 prefixNew = "";
579 }
580
581 str = str.substring(prefix.length());
582 return prefixNew + str;
583 }
584 }
585 else
586 {
587 return str;
588 }
589 }
590
591 public static int findPrefix(String[] strs, String prefix)
592 {

Callers 2

getLocationRandomMethod · 0.95
getPathBaseMethod · 0.95

Calls 2

startsWithMethod · 0.80
lengthMethod · 0.80

Tested by

no test coverage detected