My arraylist contains the following details arraylist.get(0) will be like "name,age,place,address,city" Likewise I have many entries in the arraylist.
Expected output: table Name Age Place Address City
My arraylist contains the following details arraylist.get(0) will be like "name,age,place,address,city" Likewise I have many entries in the arraylist.
Expected output: table Name Age Place Address City
You can write something like this to split it with the comma and then join it with the spaces using StringUtils
,
import com.sun.deploy.util.StringUtils;
import java.util.Arrays;
public class Main {
public static void main(String args[]) {
String value = "name,age,place,address,city";
String result = StringUtils.join(Arrays.asList(value.split(",")), " ");
System.out.println(result);
}
}