So I'm reading from a text file, that contains numbers, but i can only read as string, how can i contain it as int?

string[] lines = File.ReadAllLines("C:\\Users\\Temp\\Desktop\\WriteLines.txt");
            for (int i = 0; i < lines.Length; i++)
            {
                Console.WriteLine(lines[i]);
            }

Recommended Answers

All 2 Replies

Perfect, thank you :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.