Click here to Skip to main content
15,894,825 members
Articles / Programming Languages / C#

While brace Visual Studio C#

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
23 Nov 2012CPOL 0  
You can try this... // Read each line of the file into a string array. Each element // of the array is one line of the file. string[] lines = System.IO.File.ReadAllLines("Broj2.txt"); int[] niz = new int[3]; foreach...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
23 Nov 2012dax88 2 alternatives  
I have text file text.txt with values:1 2 32 2 52 4 63 5 73 3 86 2 44Each row need to put in one stringI have this code;StreamReader dFile = null; dFile = new StreamReader("Broj2.txt"); char[] SPACE = new char[] {' ' }; ...
Please Sign up or sign in to vote.
23 Nov 2012Bhushan Shah1988
you can do something like below: while(dFile.ReadLine()){ a = dFile.ReadLine(); data = a.Split(SPACE);}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Bangladesh Bangladesh
Do code for living...

Comments and Discussions