splits a string into a list of strings.  Trims the results and ignores empty strings
776552
public static List<String> splitAndTrimAsList(String text, String sep) {
        ArrayList<String> answer = new ArrayList<>();
        if (text != null && text.length() > 0) {
            for (String v : text.split(sep)) {
                String trim = v.trim();
                if (trim.length() > 0) {
                    answer.add(trim);
                }
            }
        }
        return answer;
    }
813024
public static List<String> split(String string, String separator)
  {
    final int separatorLength = separator.length();
    final List<String> list = new ArrayList<String>();

    int fromIndex = 0;
    for(;;) {
      int endIndex = string.indexOf(separator, fromIndex);
      if(endIndex == -1) {
        break;
      }
      if(fromIndex < endIndex) {
        list.add(string.substring(fromIndex, endIndex).trim());
      }
      fromIndex = endIndex + separatorLength;
    }
    if(fromIndex < string.length()) {
      list.add(string.substring(fromIndex).trim());
    }
    return list;
  }
649047
def _str_to_list(value, separator):
    """"""
    value_list = [item.strip() for item in value.split(separator)]
    value_list_sanitized = builtins.list(filter(None, value_list))
    if len(value_list_sanitized) > 0:
        return value_list_sanitized
    else:
        raise ValueError('Invalid list variable.')
528319
private static String trim(String string) {
        String result = string.trim();
        if (result.startsWith("\"") && result.endsWith("\"") && result.length() > 1) {
            result = result.substring(1, result.length() - 1);
        }
        return result;
    }
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;
    }
735508
def split_string(x: str, n: int) -> List[str]:
    
    # https://stackoverflow.com/questions/9475241/split-string-every-nth-character  # noqa
    return [x[i:i+n] for i in range(0, len(x), n)]
1108606
protected String[] splitToChunks(String str)
    {
        String delimiter = "[|>]";
        String[] chunks = str.split(delimiter);
        return chunks;
    }
997634
def multi_split(s, split):
    # type: (S, Iterable[S]) -> List[S]
    """"""
    for r in split:
        s = s.replace(r, "|")
    return [i for i in s.split("|") if len(i) > 0]
1206470
function splitNewlines(str) {
	if ((typeof str === 'string' || str instanceof String) && str.indexOf('\n') > -1) {
		return str.split('\n');
	}
	return str;
}
429091
def _split_basic(string):
    
    tuples = []
    for word in string.split(','):
        # Attempt to split on colon
        parts = word.split(':', 2)
        key, modifier_fn, explode = parts[0], _identity, False
        if len(parts) > 1:
            modifier_fn = functools.partial(
                _truncate, num_chars=int(parts[1]))
        if word[len(word) - 1] == '*':
            key = word[:len(word) - 1]
            explode = True
        tuples.append((key, modifier_fn, explode))
    return tuples
401074
protected List<String> trim(List<String> list) {
        if (list == null || list.size() == 0)
            return list;

        List<String> result = new ArrayList<String>();
        for (String s : list) {
            s = trim(s);

            if (s == null || s.length() == 0)
                continue;

            result.add(s);
        }

        return result;
    }
46697
def _split_tidy(self, string, maxsplit=None):
        """"""

        if maxsplit is None:
            return string.rstrip("\n").split("\t")
        else:
            return string.rstrip("\n").split("\t", maxsplit)
191813
def split_strings(subtree: dict) -> List[str]:
    
    strings = subtree["strings"]
    lengths = subtree["lengths"]
    if lengths.shape[0] == 0 and strings.shape[0] == 0:
        return []
    strings = strings[0]
    if subtree.get("str", True):
        strings = strings.decode("utf-8")
    result = [None] * lengths.shape[0]
    offset = 0
    for i, l in enumerate(lengths):
        result[i] = strings[offset:offset + l]
        offset += l
    return result
1034939
def split(cls, text):
        
        result = [line.strip('\n') for line in cls.parasep_re.split(text)]
        if result == ['', '']:
            result = ['']
        return result
618346
def _split(self, string):
        
        for i in range(len(string) - self.N + 1):
            yield string[i:i + self.N]
92166
function splitNoParen(s) {
  let results = [];
  let next;
  let str = "";
  let left = 0,
    right = 0;

  function keepResult() {
    results.push(str);
    str = "";
  }

  for (var i = 0; i < s.length; i++) {
    switch (s[i]) {
      case ",":
        if (left === right) {
          keepResult();
          left = right = 0;
        } else {
          str += s[i];
        }
        break;
      case "(":
        left++;
        str += s[i];
        break;
      case ")":
        right++;
        str += s[i];
        break;
      default:
        str += s[i];
    }
  }
  keepResult();
  return results;
}
981994
private static function split(string $string): array
    {
        $chars = [];

        for ($i = 0; $i < strlen($string); $i++) {
            $chars[] = $string[$i];
        }

        return $chars;
    }