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

Method trimTrailing

src/main/java/net/optifine/util/StrUtils.java:803–826  ·  view source on GitHub ↗
(String str, String chars)

Source from the content-addressed store, hash-verified

801 }
802
803 public static String trimTrailing(String str, String chars)
804 {
805 if (str != null && chars != null)
806 {
807 int i = str.length();
808 int j;
809
810 for (j = i; j > 0; --j)
811 {
812 char c0 = str.charAt(j - 1);
813
814 if (chars.indexOf(c0) < 0)
815 {
816 break;
817 }
818 }
819
820 return j == i ? str : str.substring(0, j);
821 }
822 else
823 {
824 return str;
825 }
826 }
827}

Callers 2

initializeMethod · 0.95
trimMethod · 0.95

Calls 2

lengthMethod · 0.80
indexOfMethod · 0.45

Tested by

no test coverage detected