nd4j-common/src/main/java/org/nd4j/util/StringUtils.java
public static String[] getTrimmedStrings(String str){
        if (null == str || str.trim().isEmpty()) {
            return emptyStringArray;
        }

        return str.trim().split("\\s*[,\n]\\s*");
    }
public static String[] getTrimmedStrings(String str){
        if (null == str || str.trim().isEmpty()) {
            return emptyStringArray;
        }

        return str.trim().split("\\s*[,\n]\\s*");
    }
Splits a comma or newline separated value <code>String</code>, trimming
leading and trailing whitespace on each value.

@param str a comma or newline separated <code>String</code> with values,
may be null
@return an array of <code>String</code> values, empty array if null String
input