I have a .txt file that contains a text like:
blah blah blah size: 80
blah blah blah blah size: 150
Aka there is some text, then a
new line, repeat... Now, I need to get that integer and store it to a variable. I use a BufferedReader that reads the text line by line and everything is normal, but, just because the length of that integer varies, I can't tell for example:
String x = line.substring(line.indexOf("size") + 6, line.indexOf("size") + 8)
because if size has 3 digits, it will only get the first two of them. Any suggestions?