List of utility methods to do List Trim
List | trimList(List Trims all items in a list of strings. List<String> result = new ArrayList<String>(source.size()); for (int i = 0; i < source.size(); i++) { String trimmedValue = source.get(i).trim(); if (trimmedValue.startsWith("\\")) { trimmedValue = trimmedValue.substring(1); result.add(trimmedValue); return result; |
List | trimListValues(List Trims all values in a list of strings List<String> trimmedList = new ArrayList<String>(); for (int i = 0; i < original.size(); i++) trimmedList.add((original.get(i).toString()).trim()); return trimmedList; |
List | trimSequence(int m, List trim Sequence List<String> result = new ArrayList<String>(); for (int i = sequence.size() - 1; result.size() < m; i--) { result.add(0, sequence.get(i)); assert result.size() == m; assert result.get(result.size() - 1).equals(sequence.get(sequence.size() - 1)); return result; |
List | trimStringLineList(List Trims a List of String lines. List<String> newLines = new ArrayList<String>(); if (lines != null) { for (String line : lines) { String str = line; str = line.trim(); String newLine = str; newLines.add(newLine); return newLines; |
List | trimStrings(List list) Trim all strings in a List. if (list == null) return null; int sz = list.size(); for (int i = 0; i < sz; i++) list.set(i, nullTrim((String) list.get(i))); return list; |
List | trimStringToNewList(List trim String To New List List<String> temp = new ArrayList<>(); String str = null; for (int i = 0; i < list.size(); i++) { temp.add(isLower ? list.get(i).trim().toLowerCase() : list.get(i).trim()); return temp; |
List | trimSuffix(List trim Suffix String endStr = strs.get(strs.size() - 1); if (SUFFIXES.contains(endStr)) { strs.remove(strs.size() - 1); return strs; |
List | trimToList(String importOrder1) trim To List ArrayList<String> strings = new ArrayList<String>(); String[] split = importOrder1.split(";"); for (String s : split) { String trim = s.trim(); if (!trim.isEmpty()) { strings.add(trim); return strings; |
void | trimToSize(List> listToTrim, int size) trim To Size listToTrim.subList(size, listToTrim.size()).clear(); |