What I want to do is set the amount of characters BinaryReader.ReadString()
reads to 1. I have this in a file
43 00 49 00 54 00 52 00 41
= C I t r a
obviously I can make it read C I t r a
by just doing BinaryReader.ReadString()
but instead what I want to do is remove the spaces between the letters and make it check to see if there are any letters after the a
. This is what I have now
//OF_name is the offset at which the name begins at
//sins there is a space between each letter, I do "I += 2"
for (int i = OF_name; i <= br.BaseStream.Length; i += 2)
{
br.BaseStream.Position = i;
byte check = br.ReadByte();
if (check == 0) break; //the file which contains the string always has a 7 byte space between the name bytes and the rest of the data.
string a = br.ReadByte().ToString(); //forgot that this just makes it be represented as a string (byte 43 => string "43" not "C")
}
Is there a way to make ReadString() read 1 character at a time instead of 7 so it would read C
then I
then t
and so on? or is there a way to do it as I do but instead of converting byte 43
to string "43"
it would convert byte 43
to string "C"
?