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
fernando mejia
NA
4
0
problems detecting tab
Mar 20 2006 12:04 AM
in the next code I wanna detect the space ' ' and the tab '\t' from text file: //open the file openFileDialog1.ShowDialog(); textBox1.Text = openFileDialog1.FileName; FILE_NAME = openFileDialog1.FileName; System.IO.StreamReader read = new System.IO.StreamReader(textBox1.Text); ListBox.CheckForIllegalCrossThreadCalls = false; //using split funtion sr = new StreamReader(FILE_NAME); char[] delimiterChars = { ' ', '\t' }; string texto; texto = read.ReadToEnd(); string[] words = texto.Split(delimiterChars); foreach (string s in words) { listBox1.Items.Add(s); } the output of the aplication make a list of any string of the file separte by delimiterChars, but if exist a tab in the file write a line; for example the text is: 111111 22 3333 4444 5555555 6666666666666 between 5555555 and 6666666666666 exist two tab characters. the best output should be: 111111 22 3333 4444 5555555 6666666666666 using the my aplication the output is: 111111 22 3333 4444 5555555 6666666666666 erase '\t' and only use the space ' ' of the delimiterChar the output is: 111111 22 3333 4444 5555555 6666666666666 how can I resolve this?? thanks.....
Reply
Answers (
0
)
News:UCCDraw Flow/Diagramming Component V9.60 Released(full Visio 12 Look! And full source codes)
Outlook Account Setings C#