I'm working on my school project and have this problem with data type. At first i'm writing data to the txt file, then i want to read it in order to sort the data. But it seems impossible to do that with string. Here is some code if necessary
string fileName = "highscore.txt";
int textToAdd = Score;
using (StreamWriter writer = new StreamWriter(fileName, true))
{
writer.Write(textToAdd+"\n");
}
using (StreamReader reader = new StreamReader(fileName, true))
{
}
The text contains multiple numbers separated by spaces, eg :
1 2 3
I want to read the numbers and sort them.