Parcourir la source

add a simpler arrayToString method

tags/2.0.1
Jonathan Cobb il y a 5 ans
Parent
révision
2c28296705
1 fichiers modifiés avec 9 ajouts et 0 suppressions
  1. +9
    -0
      src/main/java/org/cobbzilla/util/collection/ArrayUtil.java

+ 9
- 0
src/main/java/org/cobbzilla/util/collection/ArrayUtil.java Voir le fichier

@@ -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


Chargement…
Annuler
Enregistrer