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

Method replaceSuffix

src/main/java/net/optifine/util/StrUtils.java:541–564  ·  view source on GitHub ↗
(String str, String suffix, String suffixNew)

Source from the content-addressed store, hash-verified

539 }
540
541 public static String replaceSuffix(String str, String suffix, String suffixNew)
542 {
543 if (str != null && suffix != null)
544 {
545 if (!str.endsWith(suffix))
546 {
547 return str;
548 }
549 else
550 {
551 if (suffixNew == null)
552 {
553 suffixNew = "";
554 }
555
556 str = str.substring(0, str.length() - suffix.length());
557 return str + suffixNew;
558 }
559 }
560 else
561 {
562 return str;
563 }
564 }
565
566 public static String replacePrefix(String str, String prefix, String prefixNew)
567 {

Callers 2

getCustomColorsMethod · 0.95

Calls 2

endsWithMethod · 0.80
lengthMethod · 0.80

Tested by

no test coverage detected