List of utility methods to do List Trim
String | toStringList(List> list, String delimiter, boolean isTrim, boolean isRemoveEmpty) Converts a List of object to a string list separated by specified delimiter. (Do trim for each string element if isTrim is true). StringBuffer sb = new StringBuffer(); boolean firstElem = true; for (Object o : list) { String s = (o == null) ? "" : o.toString(); if (isTrim) { s = s.trim(); if (isRemoveEmpty && s.equals("")) { ... |
List | trim(final List Trim all values in row. final List<String> formattedRow = new ArrayList<>(); final Iterator<String> it = row.iterator(); while (it.hasNext()) { formattedRow.add(it.next().trim()); return formattedRow; |
void | trim(List trim for (int i = 0; i < data.size(); i++) { final String s = data.get(i); data.set(i, s.trim()); if (removeEmptyLines) { for (final Iterator<String> it = data.iterator(); it.hasNext();) { if (it.next().length() == 0) { it.remove(); ... |
void | trim(List Trims every string of a collection. for (int i = 0, n = strs.size(); i < n; i++) strs.set(i, strs.get(i).trim()); |
List | trimElements(List trim Elements for (int i = 0; i < list.size(); i++) { list.set(i, list.get(i).trim()); return removeEmptyStrings(list); |
List | trimEndDigital(List trim End Digital String endStr = strs.get(strs.size() - 1); try { Integer.parseInt(endStr); strs.remove(strs.size() - 1); } catch (NumberFormatException e) { return strs; return strs; ... |
String | trimIfLastIndex(List trim If Last Index if (isLastIndex(suggestedList, i)) { suggestedWords = trimSuggestions(suggestedWords); return suggestedWords; |
String | trimKeyFormat(String s3KeyFormat, List trim Key Format int lowestIndex = s3KeyFormat.length(); for (String disallowedKey : disallowedKeys) { int index = s3KeyFormat.indexOf(disallowedKey); if (index != -1 && index < lowestIndex) { lowestIndex = index; if (lowestIndex == -1) { ... |
List | trimLeadingWhitespaces(List Trims leading whitespaces. if (lines.isEmpty()) { return lines; String lead = null; for (int i = 0, n = lines.size(); i < n; i++) { String line = lines.get(i); if (line.isEmpty() == false) { if (lead == null) { ... |
List | trimList(List trim List if (list != null) { for (int i = 0; i < list.size(); i++) { String val = list.get(i); list.set(i, trimStr(val)); return list; |