Splits a comma separated list in to single Strings. The list can
contain expressions with commas in it.

@param text  the comma separated list
@return the Strings of the list or an empty List if text is empty or null
350223
public static List<String> splitCommaSeparatedList(String text) {
    if (text == null || text.isEmpty()) {
      return Collections.emptyList();
    }
    Matcher matcher = pattern.matcher(text);
    List<String> parts = new ArrayList<String>();
    while(matcher.find()) {
      parts.add(matcher.group().trim());
    }
    return parts;
  }
913911
public List<Hit<V>> parseText(String text)
    {
        int position = 1;
        int currentState = 0;
        List<Hit<V>> collectedEmits = new LinkedList<Hit<V>>();
        for (int i = 0; i < text.length(); ++i)
        {
            currentState = getState(currentState, text.charAt(i));
            storeEmits(position, currentState, collectedEmits);
            ++position;
        }

        return collectedEmits;
    }
408801
private static void splitInSentences(HashSet<String> sentencesSet, String text) {
		
		if (inputType == inputTypes.PARAGRAPH) { // split in multiple sentences
			LinkedList<LinkedList<Word>> sentences = Splitting.tokenizeSentences(LVMorphologyReaderAndWriter.getAnalyzer(), text);
			for (LinkedList<Word> sentence : sentences) 
			{
				if(sentence != null)
				{
					String madeSentence = "";
					for(int w = 0; w < sentence.size(); w++)
					{
						madeSentence = madeSentence + " " + sentence.get(w);
					}
					madeSentence = madeSentence.trim();
					//pārbaudam, vai teikuma atšķiribas nav punkts teikuma beigas
					if(madeSentence.length() > 0 && madeSentence.lastIndexOf(".") >= 0) madeSentence = madeSentence.substring(0, madeSentence.length() - 1);
					sentencesSet.add(madeSentence.trim());
				}
			}
		} 
	}
376258
public static Iterable<String> split(String separator, String stringToSplit) {

    String[] StringArray = stringToSplit.split(separator);

    Iterable<String> iterable = Arrays.asList(StringArray);

    return iterable;
  }
962954
public static List<String> splitToLines(String csvText) {
        List<String> newLines = new ArrayList<>();

        for (Iterator<String> lineItr = Arrays.asList(csvText.split("\r\n|\n")).iterator(); lineItr
                .hasNext();) {

            String line = lineItr.next();
            LOG.trace("line : {}", line);
            StringBuilder newLine = new StringBuilder(line);

            // 行内にダブルクオーテーションが奇数個の場合はセル内改行ありとみなし、
            // 次にダブルクオーテーションが奇数個の行までを連結して1行とする。
            if (StringUtils.countMatches(line, '"') % 2 != 0) {

                do {
                    line = lineItr.next();
                    newLine.append("\n");
                    newLine.append(line);
                } while (StringUtils.countMatches(line, '"') % 2 == 0 && lineItr.hasNext());

            }

            String newLineStr = newLine.toString();
            LOG.trace("new line : {}", newLineStr);
            newLines.add(newLine.toString());
        }

        LOG.trace("actual line number : {}", newLines.size());
        return newLines;
    }
756609
function splitImportsList(text) {
    const list = [];
    list.push(...text
        .split(',')
        .map(s => s.trim())
        .filter(s => s !== '')
    );
    return list;
}
1320514
public static List<String> splitLines(String S) {
		List<String> V=new ArrayList<>();
		int start=0;
		int pos;
		while((pos=S.indexOf('\n', start))!=-1) {
			String line;
			if(pos>start && S.charAt(pos-1)=='\r') line = S.substring(start, pos-1);
			else line = S.substring(start, pos);
			V.add(line);
			start=pos+1;
		}
		int slen = S.length();
		if(start<slen) {
			// Ignore any trailing '\r'
			if(S.charAt(slen-1)=='\r') slen--;
			String line = S.substring(start, slen);
			V.add(line);
		}
		return V;
	}
124334
public static String singleQuote(final String text) {
        final StringBuilder b = new StringBuilder((text != null ? text.length() : 0) + 2);
        b.append(SINGLE_QUOTE);
        if (text != null) {
            b.append(text);
        }
        b.append(SINGLE_QUOTE);
        return b.toString();
    }
1307659
public Collection<Text> split(char separator) {
        int pointer = pos;
        int limit = pos + len;
        int mark = pointer;

        ArrayList<Text> tokens = new ArrayList<Text>();
        while (pointer < limit) {
            if (chars[pointer] == separator) {
                tokens.add(new Text(chars, mark, pointer - mark));
                mark = pointer + 1;
            }
            pointer++;
        }
        
        tokens.add(new Text(chars, mark, limit - mark));        
        return tokens;
    }
543959
protected function splitText($text)
    {
        $punctuations = preg_quote(implode('', $this->punctuations), '/');

        $text = preg_replace('/([^\p{Han}\s'.$punctuations.']+)/u', "\t\t\t$1\t\t", $text);

        $array = [];

        foreach (preg_split('/\t\t/u', $text, -1, PREG_SPLIT_NO_EMPTY) as $item) {
            $array[] = ("\t" === $item[0])
                ? substr($item, 1)
                : preg_split('//u', $item, -1, PREG_SPLIT_NO_EMPTY);
        }

        return $this->flatten($array);
    }
1329514
public static List<List<Term>> seg2sentence(String text)
    {
        List<List<Term>> resultList = new LinkedList<List<Term>>();
        {
            for (String sentence : SentencesUtil.toSentenceList(text))
            {
                resultList.add(segment(sentence));
            }
        }

        return resultList;
    }
1363544
public static List<String> split(final CharSequence value, final String separator) {
        return newArrayList(Splitter.on(separator).omitEmptyStrings().trimResults().split(value));
    }
300830
public static String[] split(String input, char delimiter){
        if(input == null) throw new NullPointerException("input cannot be null");

        final int len = input.length();
        
        // find the number of strings to split into
        int nSplits = 1;
        for (int i = 0; i < len; i++) {
            if (input.charAt(i) == delimiter) {
                nSplits++;
            }
        }

        // do the actual splitting
        String[] result = new String[nSplits];
        int lastMark = 0;
        int lastSplit = 0;
        for (int i = 0; i < len; i++) {
            if (input.charAt(i) == delimiter) {
                result[lastSplit] = input.substring(lastMark, i);
                lastSplit++;
                lastMark = i + 1;// 1 == delimiter length
            }
        }
        result[lastSplit] = input.substring(lastMark, len);

        return result;
    }
451224
private String normalizeText(String text) {
        String[] tokens = StringUtils.split(text, "\n");
        for (int i = 0; i < tokens.length; i++) {
            tokens[i] = tokens[i].trim();
        }

        return StringUtils.join(tokens, " ").trim();
    }
499472
public static List<String> asList(String text) {
        if (StringUtils.isBlank(text)) {
            return Collections.emptyList();
        } else {
            try {
                return IOUtils.readLines(new StringReader(text));
            } catch (IOException e) {
                throw new RuntimeException("Cannot get lines", e);
            }
        }
    }
1082459
public static List<String> split(String string, String delimiter) {
        return split(string, delimiter, true);
    }
950285
public static List<String> split(
                    final String str
                    )
    {
        String  s = str;
        if (s != null) {
            s = s.trim();
        }

        List<String>  list = new ArrayList<String>();
        if (s == null || s.length() == 0) {
            return list;
        }

        String[]  tokens = s.split( "[ \t\n\r\f]" );
        // NOTE: tokens[i] may be an empty string "".

        // excludes empty strings.
        for (String  t : tokens) {
            if (t.length() > 0) {
                list.add( t );
            }
        }

        return list;
    }