I have searched and searched and I can’t find a way to do this. I am not reading from a text file on the local machine but from a server on a website (https://outcastgame.000webhostapp.com/servers/server1/Plr.txt). I can get the text and print it but I don’t know what to do next. Any suggestions would be greatly appreciated. Thanks in advance, Sam.
NOTE: I’m using C#
Split it into lines using string.Split?
If you have your text file in a string you could use StringReader to read each line sequentially too. string.Split might work better though as @andymads mentioned.
using (StringReader reader = new StringReader(input))
{
string line = string.Empty;
do
{
line = reader.ReadLine();
if (line != null)
{
// do something with the line
}
} while (line != null);
}
1 Like