public static List<String> split(final String toSplit, final String separator) {
        if (toSplit == null) {
            throw new IllegalArgumentException("toSplit cannot be null");
        }
        if (StringUtils.EMPTY.equals(separator)) {
            // split into a list of character strings
            // ie. "ab cd" -> ["a","b"," ","c","d"]
            return Arrays.asList(toSplit.split(StringUtils.EMPTY));
        }
        return Arrays.asList(StringUtils.splitByWholeSeparator(toSplit, separator));
    }
Splits the provided string into a List of string by the given separator, which will not be included in the returned List.

@param toSplit the string to split
@param separator the separator string to split by - empty will split into a List of characters
@return a List of parsed strings, not including the given separator
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/StringUtil.java