Reading text lines into an array c#?

C# discussion

Moderator: moderators

chanika
rank: <50 posts
rank: <50 posts
Posts: 24
Joined: Mon Nov 22, 2010 5:44 am
Reputation: 0
Gender: None specified

Reading text lines into an array c#?

Postby chanika » Thu Dec 02, 2010 3:27 am

I am writing an app that allows a user to navigate to a .txt file and with the file selected I need it to read the files lines creating a new array member based off each line. (though if you can think of an easier solution please feel free to mention it.)

__________________________________
khao san road

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

bumpo
rank: <50 posts
rank: <50 posts
Posts: 9
Joined: Tue Aug 18, 2009 2:08 pm
Reputation: 0
Gender: Male

Re: Reading text lines into an array c#?

Postby bumpo » Thu Dec 02, 2010 12:45 pm

chanika wrote:I am writing an app that allows a user to navigate to a .txt file and with the file selected I need it to read the files lines creating a new array member based off each line. (though if you can think of an easier solution please feel free to mention it.)

__________________________________
khao san road



String[] lines = File.ReadAllLines(fileName);


Return to “C# coding for NeoTicker”