-1

I have a situation in which I want to convert a List<String> to a single String and with commas

PS : I'm using RootTools library for command and I wanna execute a

Busybox --list command
LBes
  • 3,366
  • 1
  • 32
  • 66
DevUt
  • 1,280
  • 11
  • 24
  • You could do this by using a `StringBuilder`, iterating through each element of the list and appending it to the builder. – aochagavia Jun 25 '15 at 08:10

1 Answers1

0

Just iterate over your list and add elements as they come to a String. This is one way of doing it but there are others.

List<String> myList ;
String result = "";
//...
for (String tmp : myList) {
    result += tmp+","
}
LBes
  • 3,366
  • 1
  • 32
  • 66