I have a file with three lines in. I want to read in each line into a string. Im planning on using the java buffered reader
I thought i'd do a while loop that reads a line until it reaches end of the line (\n) then store that into a variables and continue until EOF is reached.
Reason why this won't be a duplicate question is my text file has loads of \n within it per line. As seen below. How would I then be able to read a line and store it into a string. The line breaks are needed as the display requires the option to be on its own line
example.txt
Q1: (A + B)*(A+B) \n 1. A*A + B*B \n 2. A*A +A*B + B*B \n 3. A*A +2*A*B + B*B \n
Q2: (A + B)*(A - B) \n 1. A*A + 2*B*B \n 2. A*A - B*B \n 3. A*A -2*A*B + B*B \n
Q3: sin(x)*sin(x) + cos(x)*cos(x) \n 1. 1 \n 2. 2 \n 3. 3 \n
~. Best would be to have a proper text format like TSV (tab separated file) or a YAML file...