T
TonyJ
Hello!
Now to my question.
Here I copy from a byte array into another byte array and then convert to a
string.
Is it possible to convert some part from a byte array into a string directly
without having
to use a temporary byte array as I have done below?
//byte[] buffer = new byte[30];
byte[] buffer = System.Text.Encoding.ASCII.GetBytes("This is a good test
for me");
string s = System.Text.Encoding.UTF8.GetString(buffer);
byte[] newBuffer = new byte[30];
Array.Copy(buffer,3, newBuffer, 0, 10 );
s = System.Text.Encoding.UTF8.GetString(newBuffer);
Now to my question.
Here I copy from a byte array into another byte array and then convert to a
string.
Is it possible to convert some part from a byte array into a string directly
without having
to use a temporary byte array as I have done below?
//byte[] buffer = new byte[30];
byte[] buffer = System.Text.Encoding.ASCII.GetBytes("This is a good test
for me");
string s = System.Text.Encoding.UTF8.GetString(buffer);
byte[] newBuffer = new byte[30];
Array.Copy(buffer,3, newBuffer, 0, 10 );
s = System.Text.Encoding.UTF8.GetString(newBuffer);