Java tutorial
//package com.java2s; import java.util.Arrays; import java.util.Collection; public class Main { public static String collectionToString(Collection<? extends Object> array) { String string = "'" + Arrays.toString(array.toArray()).replaceAll("\\[|\\]", "").replaceAll(", ", "','") + "'"; return string; } }