List of utility methods to do String Cut
String | cutString(String source, String output, int slength) cut String String returnVal = null; if (source != null) { if (source.length() > slength) { returnVal = source.substring(0, slength) + output; } else returnVal = source; return returnVal; ... |
String | cutString(String source, int slength) cut String String result = null; if (source != null) { if (source.length() > slength) { result = source.substring(0, slength); } else result = source; return result; ... |
String | cutText(String text, int maxLength) cut Text if (isEmpty(text) || maxLength < 0) { return text; int length = text.length(); if (length > maxLength) { return text.substring(0, maxLength); return text; ... |
String | safeCut(String str, int length) safe Cut if (str.length() > length) { return str.substring(0, length) + "..."; return str; |
String | safeCutNoDot(String str, int length) safe Cut No Dot if (str.length() > length) { return str.substring(0, length); return str; |
String | cutString(String str, int length) cut String return cutString(str, length, ""); |
String | cutString(String str, int length, String dot) cut String int strBLen = strlen(str, "GBK"); if (strBLen <= length) { return str; int temp = 0; StringBuffer sb = new StringBuffer(length); char[] ch = str.toCharArray(); for (char c : ch) { ... |
String | cutStringFromChar(String str1, String str2, int offset) cut String From Char if (isEmpty(str1)) { return ""; int start = str1.indexOf(str2); if (start != -1) { if (str1.length() > start + offset) { return str1.substring(start + offset); return ""; |
String | cutRight(final String srcStr, final String cutStr) cut Right if (srcStr == null || cutStr == null) { return srcStr; String retStr = srcStr; if (retStr.endsWith(cutStr)) { retStr = retStr.substring(0, retStr.length() - cutStr.length()); return retStr; ... |
String | cutoff(String value, int length) cutoff if (isNullOrEmpty(value) == false && value.length() > length) { return value.substring(0, length - 1) + ".."; return value; |