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.


Reply With Quote