Convert integer array to String - Java Collection Framework

Java examples for Collection Framework:Array Convert

Description

Convert integer array to String

Demo Code


//package com.java2s;

public class Main {

    public final static String toString(Integer[] array, String split) {
        StringBuilder sb = new StringBuilder();
        for (Integer item : array) {
            sb.append(item.toString());/*from  w ww. j a  v  a  2 s  .c  o  m*/
            sb.append(split);
        }
        String ret = sb.toString();
        if (ret.endsWith(split))
            ret = ret.substring(0, ret.length() - split.length());
        return ret;
    }
}

Related Tutorials