I've imported a file and turned it into a String called readFile. The file contains two lines:
qwertyuiop00%
qwertyuiop
I have already extracted the "00" from the string using: String number = readFile.substring(11, 13);
I now want to extract the "ert" and the "uio" in "qwertyuiop" When I try to use the same method as the first, like so:
String e = readFile.substring(16, 19);
String u = readFile.substring(20, 23);
and try to use:
System.out.println(e + "and" + u);
It says string index out of range.
How do I go about this? Is it because the next two words I want to extract from the string are on the second line? If so, how do I extract only the second line? I want to keep it basic, thanks.
UPDATE: it turns out only the first line of the file is being read, does anyone know how to make it so it reads both lines?