MCPcopy Create free account
hub / github.com/5zig/The-5zig-Mod / upperToDash

Method upperToDash

Utils/src/eu/the5zig/util/Utils.java:203–218  ·  view source on GitHub ↗
(String input)

Source from the content-addressed store, hash-verified

201 }
202
203 public static String upperToDash(String input) {
204 StringBuilder result = new StringBuilder();
205 for (int i = 0; i < input.length(); i++) {
206 char c = input.charAt(i);
207 if (Character.isUpperCase(c)) {
208 if (i == 0 || input.charAt(i - 1) == '_') {
209 result.append(Character.toLowerCase(c));
210 } else {
211 result.append("_").append(Character.toLowerCase(c));
212 }
213 } else {
214 result.append(c);
215 }
216 }
217 return result.toString();
218 }
219
220 /**
221 * Returns the closest value of a List to given Integer.

Callers 10

translateMethod · 0.95
getSuffixMethod · 0.95
translateMethod · 0.95
translateMethod · 0.95
translateMethod · 0.95
translateMethod · 0.95
translateMethod · 0.95
translateMethod · 0.95
translateDescriptionMethod · 0.95
getHoverTextMethod · 0.95

Calls 2

lengthMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected