NAASI
0
Q:

how to split string in java android

String currentString = "Fruit: they taste good";
String[] separated = currentString.split(":");
separated[0]; // this will contain "Fruit"
separated[1]; // this will contain " they taste good"
1
String currentString = "Custom Section";
String[] splitarray = currentString.split(" ");
separated[0]; // this will contain "Custom"
separated[1]; // this will contain "Custom"

//assign to string variable
 for (int i = 2; i < array.length; i++) {
   secondName = secondName + " " + array[i];
 }
0

New to Communities?

Join the community