Hi, I'm using MS VS 2010 C#.NET. This is somewhat of an academic question for my edification. I know there are other (and probably better) ways to do this.
I'm using the StringBuilder method to read a file from disk. Once that file is read, I was trying to pass the file's content, which is now in memory (a/k/a the "String" in memory) from the StringBuilder to the StreamReader object, so I can use some of SteamReader's BaseStream properties like Position and Length, etc.
I know that's possible, because I tried it, and it worked, but is it -- "advisable" to do that?
I figured that once the sting is in memory, it can be used by any object (as long as its technically possible). Or is there some sort of ownership that the SringBuilder places on the string it created, that would make its an undesirable practice to switch objects handling the string?