[PYTHON MATRIX-SIG] Array -> String
Jim Fulton
jim.fulton@digicool.com
Wed, 07 May 1997 11:03:38 -0400
Konrad Hinsen wrote:
>
> Has anyone found an efficient method to convert a character array into
> a string? The only solution I could come up with is
>
> string = reduce(operator.add, array)
>
> which is of course terribly inefficient.
How about
string=string.join(list(array),'')
Of course, ot would be nicer of string.join accepted any type of
sequence.
Jim
--
Jim Fulton Digital Creations
jim@digicool.com 540.371.6909
## Python is my favorite language ##
## http://www.python.org/ ##
_______________
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________