Java List Trim trimToList(String importOrder1)

Here you can find the source of trimToList(String importOrder1)

Description

trim To List

License

Apache License

Declaration

public static List<String> trimToList(String importOrder1) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {
    public static List<String> trimToList(String importOrder1) {
        ArrayList<String> strings = new ArrayList<String>();
        String[] split = importOrder1.split(";");
        for (String s : split) {
            String trim = s.trim();
            if (!trim.isEmpty()) {
                strings.add(trim);/*from  w w w . j ava 2 s .c  o m*/
            }
        }
        return strings;
    }
}

Related

  1. trimSequence(int m, List sequence)
  2. trimStringLineList(List lines)
  3. trimStrings(List list)
  4. trimStringToNewList(List list, Boolean isLower)
  5. trimSuffix(List strs)
  6. trimToSize(List listToTrim, int size)