Java Utililty Methods Array Convert to

List of utility methods to do Array Convert to

Description

The list of methods to do Array Convert to are organized into topic(s).

Method

StringarrayToSqlInList(String... values)
Erzeugt aus einem String Array einen String, welcher dem SQL Operator 'IN' übergeben werden kann.
String s = "(";
for (String cnr : values) {
    s += "'" + cnr + "',";
return s.substring(0, s.length() - 1) + ")";
StringarrayToSv(String as[], String s)
array To Sv
StringBuffer stringbuffer = new StringBuffer();
for (int i = 0; i < as.length; i++) {
    if (i > 0)
        stringbuffer.append(s);
    stringbuffer.append(as[i]);
return stringbuffer.toString();
StringarrayToSVMLightString(int[] array)
array To SVM Light String
StringBuilder str = new StringBuilder();
for (int i = 0; i < array.length; i++) {
    if (array[i] > 0) {
        str.append(i).append(":").append(array[i]).append(" ");
return str.toString();
String[]arrayToUpper(String[] values)
array To Upper
int count = values.length;
String[] results = new String[count];
for (int index = 0; index < count; index++) {
    results[index] = values[index].toUpperCase();
return results;
String[]arrayWithoutFirstsElement(final String[] array, final int elementsToRemove)
Get an array without the first element of the input array.
if (array == null) {
    return null;
if (elementsToRemove < 1) {
    return array;
if (elementsToRemove > array.length) {
    return new String[0];
...
Byte[]convertArray(byte[] a)
convert Array
Byte[] ret = new Byte[a.length];
for (int i = 0; i < a.length; i++) {
    ret[i] = a[i];
return ret;
String[]convertArray(Object columns[], int minLength)
Returns an array from the columns.
int colcount = minLength > 0 ? minLength : 0;
if (columns != null)
    colcount = columns.length;
String rc[] = new String[Math.max(colcount, minLength)];
if (colcount > 0) {
    for (int i = 0; i < colcount; i++) {
        rc[i] = columns[i] != null ? columns[i].toString() : null;
return rc;
int[]convertArray(String[] str)
convert Array
try {
    int[] strs = new int[str.length];
    for (int i = 0; i < str.length; i++) {
        strs[i] = Integer.parseInt(str[i]);
    return strs;
} catch (Exception e) {
    return null;
...
StringconvertArray2String(String[] sources)
convert Array String
String result = "";
if (sources == null || sources.length == 0) {
    return null;
for (String id : sources) {
    result += "'" + id + "',";
result = result.substring(0, result.length() - 1);
...
StringconvertArrayIndexToShipLetter(int i)
convert Array Index To Ship Letter
if (i >= 0 && i <= 9) {
    i += 48;
} else if (i >= 10 && i <= 35) {
    i += 65;
} else if (i >= 36 && i <= 51) {
    i += 97;
return (Character.toString((char) i));
...