C
C#2y ago
Czkafek

.txt files reading

How to read a particular line in .txt file and write it? Console program
8 Replies
barcode
barcode2y ago
you can read all lines then change that line and then rewrite it File.ReadAllLines File.WriteAllLines check on msdn
Czkafek
CzkafekOP2y ago
I dont want to change that line I only want to write in consol one parrticular line
barcode
barcode2y ago
File.ReadAllLines
barcode
barcode2y ago
File.ReadAllLines Method (System.IO)
Opens a text file, reads all lines of the file into a string array, and then closes the file.
barcode
barcode2y ago
or streamreader up until that line i think second one is better if there r a million lines and u want 50th line
Czkafek
CzkafekOP2y ago
em okay em how can I rewrite this:
Czkafek
CzkafekOP2y ago
Czkafek
CzkafekOP2y ago
to stop doing when It is in right line? like u know I want 50th line and it stops and 50th line and it output 50th line okay i managed and I did it tbh thanks for not answering
Want results from more Discord servers?
Add your server