One of the first things you should notice about processing text and strings in VB.NET is that there are several alternative ways to do it. You can use:
- Keywords like Open, LineInput, Print, and EOF (and Input ... more about this later) from the Microsoft.VisualBasic namespace. We'll use the FileOpen Function from this namespace in an example later in this lesson.
- Methods like Read, ReadBlock, ReadLine, and ReadToEnd from the StreamReader object in the System.IO namespace . In addition to the example in the book, you can read about how to use this class on this Microsoft MSDN page.
The book does a great job of introducing some of the topics and there are a few left out that we'll cover here. But before we get to that, there is something else that has not been covered ... and should be!
The book and these lessons have both mentioned namespaces a few times but without really explaining what's going on. In this lesson, we're talking about the Microsoft.VisualBasic and System.IO namespaces just like you were expected to know all about them. The next chapter uses the concept of namespaces a lot too. In an earlier lesson, I promised a more complete explanation of the Imports statement. This is where I deliver on my promise.