C
C#12mo ago
Ewan

✅ Help

THe code needs the variable lines to equals 1 to work. When i make it equals to 1, it works. But when i read the line which should make it 1 (it even outputs 1) it doesnt work. why?
No description
No description
5 Replies
Ewan
EwanOP12mo ago
third line changes first image works, second one doesnt when i do console.writeline(lines) on the second image below the third line, it even prints out 1 too why isnt it working?
exokem
exokem12mo ago
The first one reads the number of lines in the file, prints that number to the console and then discards the number You then set the number of lines to 1 regardless of what it actually is The second one does the same thing except it prompts for a value instead of setting to 1 always
Ewan
EwanOP12mo ago
how does it discard the number? how do i make it so it doesnt? i mean how do i make it so it does the if statements cause it should be equal to 1
exokem
exokem12mo ago
You can store the result of File.ReadAllLines in your lines variable instead of calling WriteLine
Ewan
EwanOP12mo ago
ooo i see ok ill try that IT WORKS ok thank you!
Want results from more Discord servers?
Add your server