2

I know when using a StreamReader I am able to use ReadLine() to return the whole line as a string, or even use Read() to return x amount of characters. However is there a way to read the next value of type?

In C++ you can do something like:

float x,y,z;
fileReader >> x >> y >> z;

To pipe the next three floating point values from the file stream into the variables.

I was just wondering if C# had a similar method to do this as reading a string and then decomposing it makes for un-necessary messy code.

Halfpint
  • 3,967
  • 9
  • 50
  • 92

0 Answers0