Help with String Manipulation
G. David Kuhlman
dkuhlman at netcom.com
Tue Jun 22 20:27:58 EDT 1999
>>> import array
>>> a = 'abcdef'
>>> a
'abcdef'
>>> b = array.array('c', a)
>>> b
array('c', 'abcdef')
>>> b.reverse()
>>> b
array('c', 'fedcba')
>>> c = b.tostring()
>>> c
'fedcba'
>>>
See the Python Library Reference, Sect. 5.6 "array -- Efficient
arrays of numeric values"
- Dave
Samuel G. Williams (samw at masu.wwa.com) wrote:
> I know this is a very stupid question and one that has been addressed
> within available documentation, however I need a quick hand. I am in need
> of a routine to reverse the order of a string. I have tried several things
> that have resulted in failures. It is really stupid, but I am just
> learning python. I can do this readily in C, perl, tcl, but am at a loss.
> I would appreciate any help I can get.
>
> Thanks in advance.
>
> --
>
>
More information about the Python-list
mailing list