MCPcopy
hub / github.com/jOOQ/jOOQ / padding

Method padding

jOOQ/src/main/java/org/jooq/tools/StringUtils.java:598–607  ·  view source on GitHub ↗

Returns padding using the specified delimiter repeated to a given length. StringUtils.padding(0, 'e') = "" StringUtils.padding(3, 'e') = "eee" StringUtils.padding(-2, 'e') = IndexOutOfBoundsException Note: this method doesn't not support padding with <a href="http://www.un

(int repeat, char padChar)

Source from the content-addressed store, hash-verified

596 * @throws IndexOutOfBoundsException if <code>repeat &lt; 0</code>
597 */
598 private static String padding(int repeat, char padChar) throws IndexOutOfBoundsException {
599 if (repeat < 0) {
600 throw new IndexOutOfBoundsException("Cannot pad a negative amount: " + repeat);
601 }
602 final char[] buf = new char[repeat];
603 for (int i = 0; i < buf.length; i++) {
604 buf[i] = padChar;
605 }
606 return new String(buf);
607 }
608
609 // Abbreviating
610 //-----------------------------------------------------------------------

Callers 2

rightPadMethod · 0.95
leftPadMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected