List of utility methods to do String Pad Right
String | rightPad(String str, String pad, int len) right Pad String newStr = (str == null ? "" : str); while (newStr.length() < len) { newStr = newStr + pad; if (newStr.length() > len) { newStr = newStr.substring(0, len); return newStr; ... |
String | rightPad(String string, int length) right Pad return rightPad(string, length, ' '); |
String | rightPad(String strInput, int intLength) Pad " " to String right side. byte[] byteResult = new byte[intLength]; byte[] byteInput = strInput.getBytes(); System.arraycopy(byteInput, 0, byteResult, 0, byteInput.length); for (int i = byteInput.length; i < intLength; i++) { byteResult[i] = ' '; return new String(byteResult); |
String | rightPad(String targetStr, char appendChar, int length) right Pad if (targetStr == null) { return null; int len = targetStr.length(); while (len++ < length) { targetStr += appendChar; return targetStr; ... |
String | rightPad(String toPad, int totalLength) right Pad if (toPad == null) return null; if (toPad.length() >= totalLength) { return toPad.substring(0, totalLength); StringBuffer buf = new StringBuffer(toPad); while (buf.length() < totalLength) { buf.append(" "); ... |
String | rightPad(String value, int length) right Pad StringBuffer buffer = new StringBuffer(value); while (buffer.length() < length) { buffer.append(' '); return buffer.toString(); |
String | rightPad(String value, int makeLength, char paddingCharacter) right Pad if (makeLength <= 0) { throw new IllegalArgumentException("Pad length MUST be over zero"); StringBuffer buffer = new StringBuffer(); buffer.append(value); buffer.append(buildString(paddingCharacter, makeLength - value.length())); return buffer.toString(); |
String | rightPad(String value, int tamanho, String pad) Adds pad on the right side to complete the size if (value.length() < tamanho && !pad.isEmpty()) { return rightPad(value.concat(pad), tamanho, pad); return value; |
StringBuilder | rightPad(StringBuilder pStringBuilder, int pLength, char pChar) Similar to the Oracle rpad command. while (pStringBuilder.length() < pLength) { pStringBuilder.append(pChar); return pStringBuilder; |
String | rightPadded(String src, int len) Pad the src to make it [len] bytes with trailing spaces. return rightPadded(src, len, ' '); |