|
-
Jun 30th, 2005, 11:32 AM
#1
Thread Starter
New Member
grabbing certain parts of a string
I haven't been able to think of a good way to do this, so any advice would be appreciated. I have a text file that I want some data from. All the info I need is on the same line so I have a string that I obtained using StreamReader.ReadLine(), now I need to get certain parts of it and pass it to 3 variables. The string will be something like this "1 100 90 5 0" and I need the 100, the 90, and the 5 all passed as different variables. The thing is, there is no way to know how may digits each one will be, for instance it could be "1 1000 9 20 0". So I figured the best way to do it was to determine when a space occured and read until the next space occured to get a variable but I couldn't think of a good way to do that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|