List of utility methods to do String Truncate
String | truncate(String text, int size, String charsetName) truncate return truncate(text, 0, size, charsetName, 3);
|
String | truncate(String text, int truncatedLength) Truncate a string to a max length if (text == null) { return null; if ((truncatedLength < 0) || (truncatedLength > text.length())) { return text; return text.substring(0, truncatedLength); |
String | truncate(String toTruncate, int maxSize) Truncate the given string to a maximum length provided with a pad (...) added to the end if expected size if more than 10. if (toTruncate == null || maxSize < 1 || toTruncate.length() <= maxSize) { return toTruncate; String pad = "..."; if (maxSize < 10) { pad = ""; return toTruncate.substring(0, maxSize - pad.length()).concat(pad); ... |
String | truncate(String url, int offset, int size) truncate return url.substring(offset, offset + size - 3) + "..."; |
String | Truncate(String v, int length) Truncate return v.substring(0, Math.min(v.length(), length));
|
String | truncate(String val, int maxlen) truncate return val.length() > maxlen ? (val.substring(0, maxlen - 2) + "..") : val; |
String | truncate(String value, int length) truncate return truncate(value, 0, length);
|
String | truncate(String value, int length) truncate if (value != null && value.length() > length) { value = value.substring(0, length); value += "..."; return value; |
String | truncate(String value, int length) Truncates a String to the given length. if (value != null && value.length() > length) { value = value.substring(0, length); value += DOTS; return value; |
String | truncate(String value, int length) Truncate the given string if (value != null && value.length() > length) value = value.substring(0, length); return value; |