Help with formatted reads from String^
-
I am new to the .NET framework, but have a lot of experience with C++ and MFC. I need to do a simple thing. I am using a StreamReader to read lines of text from an ASCII file. I then need to do formatted reads on the Strings^s I get. That is, I want to read substrings, integers, floats, etc, from each line. I guess I could convert the String to a char array and use sscanf(), but that seems dumb. I can't find any documentation on how to do this. Help! By the way, are there any good books on C++ .NET that go over the class library ... Thanks in advance, Tom
-
I am new to the .NET framework, but have a lot of experience with C++ and MFC. I need to do a simple thing. I am using a StreamReader to read lines of text from an ASCII file. I then need to do formatted reads on the Strings^s I get. That is, I want to read substrings, integers, floats, etc, from each line. I guess I could convert the String to a char array and use sscanf(), but that seems dumb. I can't find any documentation on how to do this. Help! By the way, are there any good books on C++ .NET that go over the class library ... Thanks in advance, Tom
-
Wy not use normal c++ stream operations or fscanf to parse the file and then convert the results to .Net String's?
System.IO.Path.IsPathRooted() does not behave as I would expect
-
The only reason I haven't done that is that I thought there must be some .NET way to do it directly on the Strings, and I wanted to learn it.. (I don't have a deadline!) Thanks, Tom
Well, I've found an answer that is workable and uses only Strings. There is a method String.Split() that lets one split the String into pieces - I use white space for the delimiter, and that gets me what I need without resorting to 'old' coding practices! Thanks, Tom