List of utility methods to do String Pad Right
String | rightPad(String s, int width) pad on right side of string to width. String tmp = ""; int npad = width - s.length(); if (npad < 0) tmp = s.substring(0, width); else if (npad == 0) tmp = s; else { tmp = s; ... |
String | rightPad(String s, int z) Right pad a String with spaces. return rightPad(s, z, " "); |
String | rightPad(String srcStr, char padChar, int destLen) right Pad if (srcStr == null) { return genStr(padChar, destLen); } else if (srcStr.length() < destLen) { StringBuilder destSrc = new StringBuilder(destLen); destSrc.append(srcStr); for (int i = srcStr.length(); i < destLen; i++) { destSrc.append(padChar); return destSrc.toString(); } else { return srcStr; |
String | rightPad(String srcString, char c, int length) right Pad if (srcString == null) { srcString = ""; int tLen = srcString.length(); if (tLen >= length) return srcString; int iMax = length - tLen; StringBuffer sb = new StringBuffer(); ... |
String | rightPad(String str, int len, char c) right Pad if (str.length() >= len) return str; StringBuilder ret = new StringBuilder(str); while (ret.length() < len) ret.append(c); return ret.toString(); |
String | rightPad(String str, int length, char padding) right Pad if (str == null) { str = ""; if (length == 0 || str.length() > length) { return str; for (int i = str.length(); i < length; i++) { str += padding; ... |
String | rightPad(String str, int max, char pad) right Pad StringBuilder builder = new StringBuilder(str); builder.setLength(max); for (int index = str.length(); index < max; index++) { builder.setCharAt(index, pad); return builder.toString(); |
String | rightPad(String str, int num, String padStr) right Pad if (num <= 0) { return str; StringBuilder sb = new StringBuilder(str.length() + num); sb.append(str); while (num-- > 0) { sb.append(padStr); return sb.toString(); |
String | rightPad(String str, int size) right Pad return rightPad(str, size, ' '); |
String | rightPad(String str, int size) right Pad return rightPad(str, size, ' '); |