TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
calfson
NA
17
0
null values in a string array
Oct 15 2004 3:14 PM
I have a code that reads in a text file of numbers that are both tab delimited as well as a carriage return at the end of each line. I have read the file into a string array, but the array does not get rid of the null values. How do I do this? Here is what I have thus far. Thanks for any help! using System; using System.IO; using System.Collections; namespace try_again { class Class1 { static void Main(string[] args) { StreamWriter swa = new StreamWriter ("c:\\afinal.txt"); StreamReader sra = new StreamReader ("c:\\ChristineWork\\test1.txt"); string aLine = sra.ReadToEnd(); string[] TokenBuffer = aLine.Split(new Char [] {' '}); foreach(string token in TokenBuffer) { if(token.Length !=0) Console.WriteLine(token); } Console.ReadLine(); sra.Close();
Reply
Answers (
16
)
perform a keypress
Data Binding problem