[IronPython] Convert Byte[] to string?

Slide slide.o.mix at gmail.com
Tue Aug 29 01:56:02 CEST 2006


If you want to use .NET you can do
System.Text.Encoding.ASCII.GetString(bytes) (Unicode, etc works too)

On 8/28/06, Gary Stephenson <garys at ihug.com.au> wrote:
> What is the best way to convert a Byte[] to a string?
>
> The best I've been able to come up with is
>
>     "".join( [chr(x) for x in bytearr] )
>
> but I just know there are better ways than that - surely ..
>
> thanks in advance,
>
> gary
>
>
> _______________________________________________
> users mailing list
> users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>



More information about the Ironpython-users mailing list