I have a String
array
String student [] = {"BAT4M0ABBB4M0ABOH4M0CCHI4U0AENG4U0DMDM4U0B"}
I need to split this for every 7 characters. It should look like this:
String student {
"BAT4M0A",
"BBB4M0A",
"BOH4M0C",
"CHI4U0A",
"ENG4U0D",
"MDM4U0B"
}
This is my code so far.
for (int i=0; i<= data.length; i++)
{
student= data[i].split(","); //data is a file of 1000 lines that is being read
if (student [2].equals(sN)) //student is a line in the each file that has been split into 11 parts
{
String timetable[]= student[9].split("(?<=\\G.......)");
System.out.println (timetable);
break;
}