I have a string of length 2000. It has a fixed format. I need to split it with various lengths. Right now I am using String.substring() method for the same. I need to split it for 70 times. Is there any better way to do this.
//code
String rawString = "01304456789AGASTECH.....";
String fisrtStr = rawString.substring(0,2);
String secondStr = rawString.substring(2,8);
String otherStr = rawString.substring(8,10); and so on