MCPcopy Index your code
hub / github.com/boazy/TWEditorEnhanced / getLabel

Method getLabel

src/main/java/StringsDatabase.java:97–139  ·  view source on GitHub ↗
(int stringRef)

Source from the content-addressed store, hash-verified

95 }
96
97 public String getLabel(int stringRef)
98 {
99 StringBuilder string = new StringBuilder(getString(stringRef).trim());
100
101 int sep = string.length() - 1;
102 if (sep > 0) {
103 char c = string.charAt(sep);
104 if ((c == '.') || (c == ':')) {
105 string.deleteCharAt(sep);
106 }
107
108 }
109
110 int index = 0;
111 while (true) {
112 sep = string.indexOf("<", index);
113 if (sep < 0) {
114 break;
115 }
116 index = sep;
117 sep = string.indexOf(">", index);
118 if (sep < 0) {
119 break;
120 }
121 string.delete(index, sep + 1);
122 }
123
124 index = 0;
125 while (true) {
126 sep = string.indexOf("{", index);
127 if (sep < 0) {
128 break;
129 }
130 index = sep;
131 sep = string.indexOf("}", index);
132 if (sep < 0) {
133 break;
134 }
135 string.delete(index, sep + 1);
136 }
137
138 return string.toString();
139 }
140
141 public String getHeading(int stringRef)
142 {

Callers

nothing calls this directly

Calls 2

getStringMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected