Chris,
Do you know the encoding of the string? If so, then use the appropriate
encoder class (AsciiEncoder, UnicodeEncoder, etc, etc).
You would just call the GetString method on the encoder class at that
point.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Chris" <no****@nospam.be> wrote in message
news:7b********************************@4ax.com...
What is the best way to convert a bytearray into a string ?
I thought I could do it using the code below, but is there anything
faster/easier than this? Thanks!
Chris
int aLength = 100000;
byte[] myByteArray = new byte[aLength ];
string myString = "";
for (int i=0; i<aLength ; i++)
{
myString += (char) myByteArray[i];
}
//work with this new string: cut out every char=='A'
myString.split('A');
...