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.Enc oding.ASCII.Get Bytes("This is a good test
for me");
string s = System.Text.Enc oding.UTF8.GetS tring(buffer);
byte[] newBuffer = new byte[30];
Array.Copy(buff er,3, newBuffer, 0, 10 );
s = System.Text.Enc oding.UTF8.GetS tring(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.Enc oding.ASCII.Get Bytes("This is a good test
for me");
string s = System.Text.Enc oding.UTF8.GetS tring(buffer);
byte[] newBuffer = new byte[30];
Array.Copy(buff er,3, newBuffer, 0, 10 );
s = System.Text.Enc oding.UTF8.GetS tring(newBuffer );
Comment