I would like to append double quotes to strings in an array and then later join them as a single string (retaining the quotes). Is there any String library which does this?
public static void main(String[] args) {
// TODO code application logic here
String [] listOfStrings = {"day", "campaign", "imps", "conversions"};
String output = "";
for (int i = 0; i < listOfStrings.length; i++) {
output += "\"" + listOfStrings[i] + "\"";
if (i != listOfStrings.length - 1) {
output += ", ";
}
}
System.out.println(output);
}
Output: "day", "campaign", "imps", "conversions"