reading in .dat file data into an array - keeping whitespaces

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2007
Posts: 3
Reputation: tphuynh is an unknown quantity at this point 
Solved Threads: 0
tphuynh tphuynh is offline Offline
Newbie Poster

reading in .dat file data into an array - keeping whitespaces

 
0
  #1
Oct 24th, 2007
Hi ,


What do I need to modify in the "System.Text.RegularExpressions.Regex.Split(contents, "\\s+", RegexOptions.None);" so the string will also keep whitespaces?

For example, in the .dat file you have:

Hello Word Test1 Test2 Test3

If you noticed, I have whitespaces between each words, I want to keep that.

so

string[0] = Hello
string[1] = " "
string[2] = Word
string[3] = " "
string[4] = Test1
string[5] = " "

..
..... and so on. Can this be done?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum


Views: 1293 | Replies: 0
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC