-
ToString Help[resolved]
Code:
byte b;
string s ="";
for(int i = 0; i < Stream.Length; i++)
{
b = (byte)Stream.ReadByte();
s += b.ToString("g");
}
I want ascci text to come out but all I get are numbers. Can anyone tell me about why and what to do. the Stream is from a text file that contains ascii text. I'm confused because I swear when I was using System.Console and reading it I used ToString("g").....
-
Code:
byte b;
string s ="";
for(int i = 0; i < Stream.Length; i++)
{
s += (char)Stream.ReadByte();
}
I'm knew I shouldn't have had that 12 pack with lunch.....
-
btw how come the second line doesnt end with a semi-colon and then the line inside the forloop has two semi-colons? :confused:
-
because I just typed it in. The first post should also have a (byte) cast on ReadByte because it returns an int.
-