![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Programmer
Join Date: Feb 2009
Posts: 84
Rep Power: 2
![]() |
separating numbers from strings
The following code below, reads a file with a numbers listed in a line separated by a comma. I print this then into a textbox. What i want to know, is how do I separate the numbers from the commas so i can place them into an array. Help please!
private void YearlyData()
{
string filePath = @"rainfall.txt";
string line;
if (File.Exists( filePath ))
{
StreamReader file = null;
try
{
file = new StreamReader( filePath );
while ((line = file.ReadLine()) != null)
{
textBoxList.Text = line;
}
}
finally
{
if (file != null)
file.Close();
}
}
} |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Positive and Negative numbers - won't compile "if" or "else" statements | 3dserge | C++ | 13 | Feb 26th, 2009 11:41 AM |
| VB.net Caluclating pythagorean numbers help | bulio | Visual Basic .NET | 5 | Oct 26th, 2008 5:14 PM |
| How to store 5 numbers from a file into 5 seperate variables? | kewlgeye | Java | 8 | Jun 26th, 2008 2:09 PM |
| code to add numbers in an array | truBlu1 | Java | 9 | Oct 12th, 2007 10:08 PM |
| random Numbers in openGL | csrocker101 | C++ | 5 | Apr 24th, 2007 8:02 PM |