Question How To Split String In Text File?

kenndev

New member
Joined
Apr 3, 2019
Messages
2
Programming Experience
Beginner
So, I am currently working on my first C# project to get me to understand how all this works and what I want it to do is read each line of a text specified by user and separate it in two using split the output to separate files however I don't know how to do this I have tried a few things but none worked so now I am searching for answer. If you know how to do this your help is appreciated.
 
Your asking two different questions and that may be the reason that you are having trouble finding an answer. It's important to break any problem down into smaller parts and then address each part separately. It's not difficult to find information on how to read lines of text from a file. There are several ways to do it but I would recommend calling either File.ReadAllLines or File.ReadLines, depending on whether you want random access to the lines or read-only, forward-only access. Either way, you'll get a String for each line and finding information on how to split a String is probably even easier.
 
Your asking two different questions and that may be the reason that you are having trouble finding an answer. It's important to break any problem down into smaller parts and then address each part separately. It's not difficult to find information on how to read lines of text from a file. There are several ways to do it but I would recommend calling either File.ReadAllLines or File.ReadLines, depending on whether you want random access to the lines or read-only, forward-only access. Either way, you'll get a String for each line and finding information on how to split a String is probably even easier.
Ohk thanks man this gives me an idea on what I should do now.
 
Back
Top Bottom