✅ How do i read the next line in a text file
So i have a text file with like 5 different lines. When i read it, it only outputs the first line, how do i swap to the next line and then the next ect?
11 Replies
How are you doing it so far?
im doing it like this however it just reads the first line
i dont want it to read all the lines at once but to output each line in the file individually
How would you normally repeat an action with code?
uhh not sure?
i just wanna know how to swap lines
because i can only read the first line
Well ReadLine() will read the next line (as it has done in your code), so you just need a way to keep asking for the next line, a loop of some sort perhaps?
does RealLine() read every new line??
it reads the next line
from where the reader currently is
oh!!
i didnt know using ReadLine multiple times goes onto the next line
If you hover pretty much any symbol in your ide it will give you information on what it does/how it works:
ooo ok thank you!!!