1String data = "1,Diego Maradona,Footballer,Argentina";
2String[] items = data.split(",");
3for (String item : items)
4{
5 System.out.println("item = " + item);
6}
1 String s = "Some St., Some City, Some post code";
2 String strings[] = s.split(",");
3
4 for(int i = 0; i < strings.length; i++){
5 strings[i] = strings[i].trim();
6 strings[i] += ",\n";
7 }
8 s = "";
9
10 for(int i = 0; i < strings.length; i++)
11 s += strings[i];