Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C# Stream Reader
#1
Hello guys, i need help.
How in C# with Stream Reader read String?
I have file text.txt
Her contents:

stringone
stringtwho
stringthird

How in C# i can full find NEXT string?
I get string stringone , and how me get next string stringwho (i dont know how next string named (be called).

If i know i make check.Example if(stringone )
{Show("Next stringtwo"} ... ets
But i IDK next name string!
Thanks in Feauture
OMA
[Image: One_Man_Army_Bag_render_MW2.PNG]
Reply

#2
Use streamreader.
snip
Code:
List<string> readAllLines(string path) {
    var lines = new List<string>();
    using(var reader = new StreamReader(path)) {
        while (reader.Peek() >= 0) {
                    lines.add(reader.ReadLine());
                }
    }
    return lines;
}
Reply

#3
File.ReadAllText
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#4
Thanks @dtx12 & @Nekochan
OMA
[Image: One_Man_Army_Bag_render_MW2.PNG]
Reply



Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.