MCPcopy Create free account
hub / github.com/RealTimeGenomics/rtg-tools / padLeft

Method padLeft

src/main/java/com/rtg/util/StringUtils.java:253–256  ·  view source on GitHub ↗

Pad a string on the left with spaces till it is at least the specified length. @param s initial string. @param length to pad the string to. @return padded string.

(final String s, final int length)

Source from the content-addressed store, hash-verified

251 * @return padded string.
252 */
253 public static String padLeft(final String s, final int length) {
254 final int pad = length - s.length();
255 return pad > 0 ? spaces(pad) + s : s;
256 }
257
258 /**
259 * Pad a string on the right with spaces till it is at least the specified length.

Callers 2

formatTimeRowMethod · 0.95
testPadLeftMethod · 0.95

Calls 2

spacesMethod · 0.95
lengthMethod · 0.65

Tested by 2

formatTimeRowMethod · 0.76
testPadLeftMethod · 0.76