Extract as array of string.

@param value the value
@return the list
549280
public static List<String> extractAsArrayOfString(String value) {
		Matcher matcher = arrayPattern.matcher(value);

		List<String> result = new ArrayList<String>();

		//	we need to unscape javascript format, otherwise string like " where id like '%' " will become " where id like \'%\' " 
		while (matcher.find()) {
			result.add(StringEscapeUtils.unescapeEcmaScript(matcher.group(1)));
		}

		return result;
	}
412876
public static String valueToString(Object value) {
		if (value == null) {
			return "null";
		} else if (!value.getClass().isArray()) {
			return value.toString();
		}

		StringBuilder sb = new StringBuilder();
		valueToString(sb, value);
		return sb.toString();
	}
426971
String convertToString(Object value) {
        if (value == null) {
            return null;
        } else if (value instanceof String) {
            return (String) value;
        } else if (value instanceof List) {
            List<?> list = ((List<?>) value);
            if (list.size() == 0) {
                return EvaluationContext.EMPTY_STRING;
            } else if (list.size() == 1) {
                String strValue = String.valueOf(list.get(0));
                return escapeValue(strValue);
            } else {
                StringBuilder builder = new StringBuilder();
                Iterator<?> iterator = list.iterator();
                while (iterator.hasNext()) {
                    String strValue = String.valueOf(iterator.next());
                    strValue = escapeValue(strValue);
                    builder.append(strValue);
                    if (iterator.hasNext()) {
                        builder.append(", ");
                    }
                }
                return builder.toString();
            }
        } else if (value instanceof String[]) {
            String[] array = (String[]) value;
            if (array.length == 0) {
                return EvaluationContext.EMPTY_STRING;
            } else if (array.length == 1) {
                return escapeValue(array[0]);
            } else {
                StringBuilder builder = new StringBuilder();
                for (int i = 0; i < array.length; i++) {
                    String strValue = escapeValue(array[i]);
                    builder.append(strValue);
                    if (i + 1 < array.length) {
                        builder.append(", ");
                    }
                }
                return builder.toString();
            }
        } else if (value.getClass().isArray()) {
            int size = Array.getLength(value);
            if (size == 0) {
                return EvaluationContext.EMPTY_STRING;
            } else if (size == 1) {
                String strValue = String.valueOf(Array.get(value, 0));
                return escapeValue(strValue);
            } else {
                StringBuilder builder = new StringBuilder();
                for (int i = 0; i < size; i++) {
                    String strValue = String.valueOf(Array.get(value, i));
                    strValue = escapeValue(strValue);
                    builder.append(strValue);
                    if (i + 1 < size) {
                        builder.append(", ");
                    }
                }
                return builder.toString();
            }
        } else {
            return value.toString();
        }
    }
425283
private String convertSimpleArrayToString(Object value) {
        String answer;
        int length = Array.getLength(value);
        StringBuffer temp = new StringBuffer("{");
        for (int i = 0; i < length && i < MAX_ARRAY_LENGTH; i++) {
            Object element = Array.get(value, i);
            if ((i > 0) && !(element instanceof Character))
                temp.append(",");
            temp.append(element);
        }
        if (length > MAX_ARRAY_LENGTH) {
            if (!(Array.get(value, 0) instanceof Character))
                temp.append(",");
            temp.append("...");
        }
        temp.append("} /* array length = ");
        temp.append(Integer.toString(Array.getLength(value)));
        temp.append(" */");
        answer = temp.toString();
        return answer;
    }
565764
public static String[] asStringArray(Object value) {
        List<String> collection = asCollection(value).stream()
                                                     .map(ConfigUtil::asString)
                                                     .collect(Collectors.toList());
        return collection.toArray(new String[collection.size()]);
    }
1244636
public boolean isArray(Object value) {

        return value != null && (value.getClass().isArray() || value instanceof List);
    }
480120
private List<String> getCollection(String value) {
        String arrayString = value;

        if (arrayString.startsWith("[") && arrayString.endsWith("]")) {
            arrayString = arrayString.substring(1, arrayString.length()-1);
        }

        return Arrays.stream(StringUtils.commaDelimitedListToStringArray(arrayString))
                .map(String::trim)
                .map(VariableUtils::cutOffDoubleQuotes)
                .collect(Collectors.toList());
    }
471317
private String formatValue(String[] value) {

    String ret = "";
    for(int i=0;i<value.length;i++) {
      ret += value[i];
      if(i<value.length-1) ret+="\n";
    }
    return ret;

  }
33143
def toListString(value):
        
        if TypeConverters._can_convert_to_list(value):
            value = TypeConverters.toList(value)
            if all(map(lambda v: TypeConverters._can_convert_to_string(v), value)):
                return [TypeConverters.toString(v) for v in value]
        raise TypeError("Could not convert %s to list of strings" % value)
17285
private Object asList(Object value) {
        Class<?> componentClass = value.getClass().getComponentType();
        if (componentClass.isPrimitive()) {
            if (componentClass.equals(int.class)) {
                return asIntList(value);
            } else if (componentClass.equals(long.class)) {
                return asLongList(value);
            } else if (componentClass.equals(boolean.class)) {
                return asBooleanList(value);
            } else if (componentClass.equals(short.class)) {
                return asShortList(value);
            } else if (componentClass.equals(byte.class)) {
                return asByteList(value);
            } else {
                return asCharList(value);
            }
        } else {
            return asList(value, componentClass);
        }
    }
443408
List<String> split(String value) {
        if (value == null) {
            return Collections.emptyList();
        }
        String[] parts = value.split(",", -1);
        return Arrays.asList(parts);
    }
1096977
@SuppressWarnings("unchecked")
    public static String[] toStringArray(Object entry) {
        if (entry instanceof String[]) {
            return (String[]) entry;
        } else if (entry instanceof OTrackedList) {
            OTrackedList<String> list = (OTrackedList<String>) entry;
            return list.toArray(new String[list.size()]);
        }
        return new String[0];
    }
1334540
public static String[] split(String value) {
        if (value == null || "".equals(value)) {
            return EMPTY_STRING_ARRAY;
        }
        int len = value.length();
        List<String> list = new LinkedList<>();
        boolean collectingSpace = true;
        int start = 0;
        for (int i = 0; i < len; i++) {
            char c = value.charAt(i);
            if (c == ' ' || c == '\t' || c == '\n' || c == '\r') {
                if (!collectingSpace) {
                    list.add(value.substring(start, i));
                    collectingSpace = true;
                }
            } else {
                if (collectingSpace) {
                    start = i;
                    collectingSpace = false;
                }
            }
        }
        if (start < len) {
            int end = len;
            for (int i = 1; len > i; i++) {
                char c = value.charAt(len - i);
                if (c == ' ' || c == '\t' || c == '\n' || c == '\r') {
                    end--;
                    continue;
                }
                break;
            }
            list.add(value.substring(start, end));
        }
        return list.toArray(EMPTY_STRING_ARRAY);
    }
452977
public static String[] asStringArray(List<String> input) {
		String[] result = new String[input.size()];

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

		return result;
	}
769864
private List<Integer> extractDigits(final String value) throws NumberFormatException {
    final List<Integer> digits = new ArrayList<>(value.length());
    final char[] chars = value.toCharArray();
    for (final char c : chars) {
      digits.add(this.extractDigit(c));
    }
    return digits;
  }
95313
private List<String> splitRRULEValues(String value) {
		List<String> values = new ArrayList<String>();
		Pattern p = Pattern.compile("#\\d+|\\d{8}T\\d{6}Z?");
		Matcher m = p.matcher(value);

		int prevIndex = 0;
		while (m.find()) {
			int end = m.end();
			String subValue = value.substring(prevIndex, end).trim();
			values.add(subValue);
			prevIndex = end;
		}
		String subValue = value.substring(prevIndex).trim();
		if (subValue.length() > 0) {
			values.add(subValue);
		}

		return values;
	}
1363544
public static List<String> split(final CharSequence value, final String separator) {
        return newArrayList(Splitter.on(separator).omitEmptyStrings().trimResults().split(value));
    }