split string to textview in android

Solutions on MaxInterview for split string to textview in android by the best coders in the world

showing results for - "split string to textview in android"
Federica
19 Jul 2017
1String data = "1,Diego Maradona,Footballer,Argentina";
2String[] items = data.split(",");
3for (String item : items)
4{
5    System.out.println("item = " + item);
6}
Nabil
19 May 2018
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];