Applies {@link String#trim()} to each String in the {@link List}

@return the input list, mutated in place, containing trimmed strings.
190693
private static <L extends List<String>> L trimStringList(L strings)
    {
        for (ListIterator<String> listIt = strings.listIterator(); listIt.hasNext(); )
        {
            String string = listIt.next().trim();
            listIt.set(string);
        }
        return strings;
    }
1050805
public @Nonnull Iterable<String> strings() {
        final JsonArray parent=this;
        return () -> {
            final Iterator<JsonElement> iterator = parent.iterator();
            return new Iterator<String>() {

                @Override
                public boolean hasNext() {
                    return iterator.hasNext();
                }

                @Override
                public String next() {
                    return iterator.next().asString();
                }

                @Override
                public void remove() {
                    iterator.remove();
                }
            };
        };
    }
334118
protected List<String> trim(List<String> comments) {
        List<String> trimComments = new ArrayList<>();
        int n = 0;
        boolean tryRemoveWhitespace = true;
        while (tryRemoveWhitespace) {
            boolean allLinesAreShorter = true;
            for (String comment : comments) {
                if (comment.length() <= n) {
                    continue;
                }
                if (comment.charAt(n) != ' ') {
                    tryRemoveWhitespace = false;
                }
                allLinesAreShorter = false;
            }
            if (allLinesAreShorter) {
                break;
            }
            if (tryRemoveWhitespace) {
                n++;
            }
        }
        for (String comment : comments) {
            if (comment.length() > n) {
                String substring = comment.substring(n);
                trimComments.add(substring);
            } else {
                trimComments.add("");
            }
        }
        return trimComments;
    }
1343442
public Span trim(final CharSequence text) {

    int newStartOffset = getStart();

    for (int i = getStart(); i < getEnd()
        && StringUtil.isWhitespace(text.charAt(i)); i++) {
      newStartOffset++;
    }

    int newEndOffset = getEnd();
    for (int i = getEnd(); i > getStart()
        && StringUtil.isWhitespace(text.charAt(i - 1)); i--) {
      newEndOffset--;
    }

    if (newStartOffset == getStart() && newEndOffset == getEnd()) {
      return this;
    } else if (newStartOffset > newEndOffset) {
      return new Span(getStart(), getStart(), getType());
    } else {
      return new Span(newStartOffset, newEndOffset, getType());
    }
  }
685743
public void trim()
	{
		List<byte[]> chunkList = mChunkList;
		while (chunkList.size() - 1 > mCurrentChunkIndex)
		{
			chunkList.remove(chunkList.size() - 1);
		}
	}
904396
public static String trimTrailing(String str) {
        if (str == null) {
            return null;
        }
        int len = str.length();
        for (; len > 0; len--) {
            if (!Character.isWhitespace(str.charAt(len - 1))) {
                break;
            }
        }
        return str.substring(0, len);
    }
394600
public List<String> getFormat() {
        return impl.getFormat() == null? null : Collections.unmodifiableList(impl.getFormat());
    }
342860
public static String trimFront(String input) {
		int i = 0;
		while (i < input.length() && Character.isWhitespace(input.charAt(i)))
			i++;
		return input.substring(i);
	}
792709
protected String trim(String s) {
        if (s == null || s.length() == 0)
            return s;

        return s.trim();
    }
365742
public static Optional<String> trimEnd(final String input) {
        return Optional.ofNullable(input).filter(v -> !v.isEmpty()).map(Strman::rightTrim);
    }
810635
public Set<String> getModifies() {
    Set<String> modifies = info == null ? null : info.modifies;
    return modifies == null ? Collections.<String>emptySet() : modifies;
  }
338923
private List<Statement> trim(List<Statement> nodes) throws ParseException {
        if (!removeDirectiveBlankLine) {
            return nodes;
        }

        // 待移除的空的 Text Node (主要是 Text Node 不允许为空的内容，只能在循环外把它delete了)
        List<Integer> empty_text_index_list = new ArrayList<Integer>();

        for (int i = 0; i < nodes.size(); i++) {
            Statement node = nodes.get(i);

            if (isTrimableDirective(node)) {
                if (i > 0) {
                    int prev_index = i - 1;
                    Statement prev = nodes.get(prev_index);

                    if (isNoLiteralText(prev)
                            && !empty_text_index_list.contains(prev_index)) {
                        // 删除上一个文本节点最后一个\n之后的所有空白符
                        String text = ((Text) prev).getContent();
                        int pos = text.lastIndexOf('\n');
                        if (pos >= 0) {
                            String tail = text.substring(pos + 1);
                            if (tail.length() > 0 && tail.trim().length() == 0) {
                                text = text.substring(0, pos + 1);
                                if (text.length() == 0) {
                                    empty_text_index_list.add(prev_index); // 将会是空节点，加入到待删除队列
                                } else {
                                    nodes.set(prev_index, new Text(text, false,
                                            prev.getOffset())); // 修改
                                }
                            }
                        }
                    }
                } // prev text node

                if (i + 1 < nodes.size()) {
                    int next_index = i + 1;
                    Statement next = nodes.get(next_index);

                    if (isNoLiteralText(next)) {
                        // 删除下一个文本节点地一个\n之前的所有空白符
                        String text = ((Text) next).getContent();
                        int pos = text.indexOf('\n');
                        if (pos >= 0) {
                            String head = text.substring(0, pos);
                            if (head.trim().length() == 0) {
                                text = text.substring(pos + 1);
                                boolean isEmptyNode = false;
                                if (text.length() == 0) {
                                    empty_text_index_list.add(next_index); // 将会是空节点，加入到待删除队列
                                    isEmptyNode = true;
                                } else if (text.indexOf('\n') == -1
                                        && text.trim().length() == 0) {
                                    // 看看下面是不是还是个指令，是不是可以全部丢掉
                                    if (next_index + 1 < nodes.size()) {
                                        Statement next_next = nodes
                                                .get(next_index + 1);
                                        if (isTrimableDirective(next_next)) {
                                            empty_text_index_list
                                                    .add(next_index); // 将会是空节点，加入到待删除队列
                                            isEmptyNode = true;
                                        }
                                    }
                                }
                                if (!isEmptyNode) {
                                    nodes.set(next_index, new Text(text, false,
                                            next.getOffset())); // 修改
                                }
                            }
                        }
                        i++; // skip next
                    }
                } // next text node
            } // not Directive
        }

        // 删除需要删掉的空节点。
        if (empty_text_index_list.size() > 0) {
            // 必须先删除后面的node
            for (int i = empty_text_index_list.size() - 1; i >= 0; i--) {
                int index = empty_text_index_list.get(i); // 必须转成小 int,
                // 否则就是删除对象，不是删除指定的index
                nodes.remove(index);
            }
        }
        return nodes;
    }
175
public static String[] trimAll(final String[] strings) {
        if (null == strings) {
            return null;
        }

        return Arrays.stream(strings).map(StringUtils::trim).toArray(size -> new String[size]);
    }
902363
private static void trimPadding(List<Element> elements)
    {
        for (ListIterator<Element> it = elements.listIterator(elements.size()); it.hasPrevious();) {
            Element element = it.previous();

            if (element.compareTo(null) == 0) {
                it.remove();
            } else {
                break;
            }
        }
    }
1268566
@Nonnull
    public static List<String> removeEmptyEntries(@Nullable List<String> input) {
        if(input==null) {
            return Collections.emptyList();
        }
        Iterable<String> trimmedInputs = Iterables.transform(input, TRIM);
        Iterable<String> nonEmptyInputs = Iterables.filter(trimmedInputs, NOT_EMPTY);
        return Lists.newArrayList(nonEmptyInputs);
    }
194779
public static List<String> toList(String[] input) {
        List<String> ret = new ArrayList<>();
        for (int i = 0; i < input.length; i++)
            ret.add(input[i]);
        return ret;
    }
895269
public static void trim(List<String> value) {
		if (value==null) return;
		for (int i=0; i<value.size(); i++) {
			value.set(i, value.get(i).trim());
		}
		
	}