ソースを参照

add a simpler arrayToString method

tags/2.0.1
Jonathan Cobb 5年前
コミット
2c28296705
1個のファイルの変更9行の追加0行の削除
  1. +9
    -0
      src/main/java/org/cobbzilla/util/collection/ArrayUtil.java

+ 9
- 0
src/main/java/org/cobbzilla/util/collection/ArrayUtil.java ファイルの表示

@@ -79,6 +79,15 @@ public class ArrayUtil {
return new ArrayList<>(result);
}

/**
* Produce a delimited string from an array. Null values will appear as "null"
* @param array the array to consider
* @return the result of calling .toString on each array element, or "null" for null elements, separated by the given delimiter.
*/
public static String arrayToString(Object[] array) {
return arrayToString(array, ", ", "null");
}

/**
* Produce a delimited string from an array. Null values will appear as "null"
* @param array the array to consider


読み込み中…
キャンセル
保存