Java tutorial
//package com.java2s; import java.util.ArrayList; public class Main { public static String arrayToString(String message, ArrayList<Integer> arr) { StringBuilder resString = new StringBuilder(); resString.append(message); for (int i : arr) { resString.append(i + 1).append(", "); } resString.delete(resString.length() - 2, resString.length()); return resString.toString(); } }