Convert a string array into a list
@param input the input to create the list from
@return the created array
194779
public static List<String> toList(String[] input) {
        List<String> ret = new ArrayList<>();
        for (int i = 0; i < input.length; i++)
            ret.add(input[i]);
        return ret;
    }
722125
public String normalize(String input) {
		char[] c = input.toCharArray();
		normalise(c);
		return new String(c);
	}
147559
public static Array listToArrayTrim(String list, char delimiter) {
	if (list.length() == 0) return new ArrayImpl();
	// remove at start
	while (list.indexOf(delimiter) == 0) {
	    list = list.substring(1);
	}
	int len = list.length();
	if (len == 0) return new ArrayImpl();
	while (list.lastIndexOf(delimiter) == len - 1) {
	    list = list.substring(0, len - 1 < 0 ? 0 : len - 1);
	    len = list.length();
	}
	return listToArray(list, delimiter);
    }
1215029
public static <T> List<T> arrayToList(T[] array) {
        List<T> list = null;
        if (array != null) {
            list = new ArrayList<>();
            for (T e : array) {
                list.add(e);
            }
        }
        return list;
    }
865203
def string_array_to_list(a):
    
    result = []
    length = javabridge.get_env().get_array_length(a)
    wrapped = javabridge.get_env().get_object_array_elements(a)
    for i in range(length):
        result.append(javabridge.get_env().get_string(wrapped[i]))
    return result
228496
List<String> parseJsStringArray(String input)
      throws ParseException {
    List<String> results = new ArrayList<>();
    int indexStart = input.indexOf('[');
    int indexEnd = input.lastIndexOf(']');
    if ((indexStart == -1) || (indexEnd == -1)) {
      throw new ParseException("Syntax error when parsing JS array", true /* fatal */);
    }
    String innerValues = input.substring(indexStart + 1, indexEnd);

    if (!innerValues.trim().isEmpty()) {
      valueMatcher.reset(innerValues);
      for (;;) {
        // Parse the current string literal.
        if (!valueMatcher.lookingAt()) {
          throw new ParseException("Syntax error in JS String literal", true /* fatal */);
        }
        // Add it to the results.
        results.add(valueMatcher.group(1) != null ?
            valueMatcher.group(1) : valueMatcher.group(2));
        if (valueMatcher.hitEnd()) {
          break;
        }
        // Ensure there is a comma after the value.
        if (innerValues.charAt(valueMatcher.end()) != ',') {
          throw new ParseException("Missing comma in string array", true /* fatal */);
        }
        // Move to the next value.
        valueMatcher.region(valueMatcher.end() + 1, valueMatcher.regionEnd());
      }
    }
    return results;
  }
942704
public static String[] toStringArray(final String objname, final String argin) {
        final String[] array = new String[2];
        array[0] = objname;
        array[1] = argin;
        return array;
    }
870874
public static int[] asIntegerTypeArray(List<Integer> input) {
		int[] result = new int[input.size()];

		for (int i = 0; i < result.length; i++) {
			result[i] = input.get(i);
		}

		return result;
	}
618179
public static String[] merge(final String[] input, final String[] list) {
        final List<String> v = new ArrayList<String>(Arrays.asList(list));
        for (final String anInput : input) {
            if ((null != anInput) && !v.contains(anInput)) {
                v.add(anInput);
            }
        }
        return v.toArray(new String[v.size()]);
    }
534098
public static String[] trimStringArray(final String[] input) {
        final ArrayList<String> output = new ArrayList<String>();
        for (int i = 0; i < input.length; i++) {
            String s = input[i].trim();
            if (!s.equals("")) output.add(s);
        }
        return output.toArray(new String[0]);
    }
537014
public Token[] tokenize(String input) 
    {
    	char[] stringChars =  input.toCharArray();
        List<Token> tokens = new ArrayList<Token>();
        for (char c : stringChars) {
			if(Character.isLetterOrDigit(c)){
				tokens.add(internSomething(Character.toString(c)));
			}
			else if (!ignorePunctuation && !Character.isWhitespace(c)) {
				tokens.add(internSomething(Character.toString(c)));
			}
		}
        return (Token[]) tokens.toArray(new BasicToken[tokens.size()]);
    }
973329
public static <T extends Value> List<List<T>> split(List<T> input, long targetSize) {
        Collections.sort(input, new Comparator<Value>() {
            public int compare(Value o1, Value o2) {
                return new Long(o1.getValue()).compareTo(new Long(o2.getValue()));
            }
        });
        List<T> smaller = new ArrayList<T>();
        List<T> bigger = new ArrayList<T>();
        for(T v: input) {
            if(v.getValue() >= targetSize) {
                bigger.add(v);
            } else {
                smaller.add(v);
            }
        }
        List<List<T>> ret = new ArrayList<List<T>>();
        for(T b: bigger) {
            List<T> elem = new ArrayList<T>();
            elem.add(b);
            ret.add(elem);
        }

        while(smaller.size()>0) {
            ret.add(removeBestSubset(smaller, targetSize));
        }
        return ret;
    }
229215
public static Array listToArray(String list, char delimiter) {
	if (list.length() == 0) return new ArrayImpl();
	int len = list.length();
	int last = 0;

	Array array = new ArrayImpl();
	try {
	    for (int i = 0; i < len; i++) {
		if (list.charAt(i) == delimiter) {
		    array.append(list.substring(last, i));
		    last = i + 1;
		}
	    }
	    if (last <= len) array.append(list.substring(last));
	}
	catch (PageException e) {}
	return array;
    }
772893
public static String[] toStringArray(final String objname, final String[] argin) {
        final String[] array = new String[1 + argin.length];
        array[0] = objname;
        System.arraycopy(argin, 0, array, 1, argin.length);
        return array;
    }
1033235
public static List<String> readStringList(InputStream input) throws IOException {
        return readStringList(input, Charset.defaultCharset());
    }
637726
@SneakyThrows
   public static List<String> split(CharSequence input, char separator) {
      if (input == null) {
         return new ArrayList<>();
      }
      Preconditions.checkArgument(separator != '"', "Separator cannot be a quote");
      try (CSVReader reader = CSV.builder().delimiter(separator).reader(new StringReader(input.toString()))) {
         List<String> all = new ArrayList<>();
         List<String> row;
         while ((row = reader.nextRow()) != null) {
            all.addAll(row);
         }
         return all;
      }
   }
408086
public static String[] split(String input, String regex) {
    if (input == null) {
      return null;
    }
    String[] arr = input.split(regex);
    List<String> results = new ArrayList<>(arr.length);
    for (String a : arr) {
      if (!a.trim().isEmpty()) {
        results.add(a);
      }
    }
    return results.toArray(new String[0]);
  }