I'm new to Java and didn't find any exact solution for my scenario. I have a large string which is 1500 length.
For example :
String inData = "THISKALJSKAJFDSKJDKSJ KSJDLKJSFKD LSKJDFKSJ, ASA:..";
I have a fixed format for these 1500 length. I have to split the string into 200+ fields based on each field fixed length. I found something like below.
String firstFld = inData.substring(0, 2);
String secondFld = inData.substring(3, 10);
String thirdFld = inData.substring(11, 13);
can anyone please suggest with better way of doing the split instead of declaring 200 string variables and store them there or loading them to a String Array ? I plan to to build an xml with all these fields after getting them.
I appreciate all your help!
arrayof length 200