Такая полезная функция как implode отсутствует в java.
Исправим:
Вот какие типы можно вообще в join использовать:
Полное описание класса StringUtils
Исправим:
import org.apache.commons.lang.StringUtils; public static String implodeArray(String[] inputArray, String glueString) { /** Output variable */ String output = ""; output = StringUtils.join( inputArray, glueString ); return output; }
Вот какие типы можно вообще в join использовать:
static String | join(Collection collection, char separator) Joins the elements of the provided Collection into a single String containing the provided elements. |
static String | join(Collection collection, String separator) Joins the elements of the provided Collection into a single String containing the provided elements. |
static String | join(Iterator iterator, char separator) Joins the elements of the provided Iterator into a single String containing the provided elements. |
static String | join(Iterator iterator, String separator) Joins the elements of the provided Iterator into a single String containing the provided elements. |
static String | join(Object[] array) Joins the elements of the provided array into a single String containing the provided list of elements. |
static String | join(Object[] array, char separator) Joins the elements of the provided array into a single String containing the provided list of elements. |
static String | join(Object[] array, char separator, int startIndex, int endIndex) Joins the elements of the provided array into a single String containing the provided list of elements. |
static String | join(Object[] array, String separator) Joins the elements of the provided array into a single String containing the provided list of elements. |
static String | join(Object[] array, String separator, int startIndex, int endIndex) Joins the elements of the provided array into a single String containing the provided list of elements. |
Комментариев нет:
Отправить комментарий