List of utility methods to do String Pad Right
String | rightPad(String str, int size) Right pad a String with spaces. return rightPad(str, size, " "); |
String | rightPad(String str, int size) right Pad return rightPad(str, size, ' '); |
String | rightPad(String str, int size) right Pad return rightPad(str, size, ' '); |
String | rightPad(String str, int size, char padChar) Right pad a String with a specified character.
The String is padded to the size of size .
StringUtils.rightPad(null, *, *) = null StringUtils.rightPad("", 3, 'z') = "zzz" StringUtils.rightPad("bat", 3, 'z') = "bat" StringUtils.rightPad("bat", 5, 'z') = "batzz" StringUtils.rightPad("bat", 1, 'z') = "bat" StringUtils.rightPad("bat", -1, 'z') = "bat" if (str == null) { return null; int pads = size - str.length(); if (pads <= 0) { return str; if (pads > PAD_LIMIT) { ... |
String | rightPad(String str, int size, char padChar) Right pad a String with a specified character. The String is padded to the size of StringUtils.rightPad(null, *, *) = null StringUtils.rightPad("", 3, 'z') = "zzz" StringUtils.rightPad("bat", 3, 'z') = "bat" StringUtils.rightPad("bat", 5, 'z') = "batzz" StringUtils.rightPad("bat", 1, 'z') = "bat" StringUtils.rightPad("bat", -1, 'z') = "bat" if (str == null) { return null; int pads = size - str.length(); if (pads <= 0) { return str; if (pads > PAD_LIMIT) { ... |
String | rightPad(String str, int size, char padChar) right Pad if (str == null) { return null; int pads = size - str.length(); if (pads <= 0) { return str; if (pads > PAD_LIMIT) { ... |
String | rightPad(String str, int size, char padChar) right Pad if (str == null) { return null; int pads = size - str.length(); if (pads <= 0) { return str; if (pads > PAD_LIMIT) { ... |
String | rightPad(String str, int size, String padStr) right Pad if (str == null) { return null; if (isEmpty(padStr)) { padStr = " "; int padLen = padStr.length(); int strLen = str.length(); ... |
String | rightPad(String str, int width) right Pad return rightPad(str, width, ' '); |
String | rightPad(String str, int width, char padding) right Pad StringBuilder buff = new StringBuilder(str); for (int i = 0; i < width; ++i) { buff.append(padding); return buff.substring(0, width); |