Re: how to prepend string to a string?
- From: Peter Hansen <peter@xxxxxxxxxxx>
- Date: Tue, 31 May 2005 14:34:47 -0400
flamesrock wrote:
Thanks for all the responses :)
You're right, Kent. That does exactly what I need it to.
Anyways.. if there isn't a prepend function, I'm going to request it from the devs. Would be cool to see that in future versions of python.
Since strings cannot be modified in-place (they are "immutable"), the concept of prepend for a string is meaningless (and so is append). Instead, you simply build a new string from other bits, and it's entirely up to you which comes first and which comes second (thus providing implementations equivalent to prepend or append, as you need).
-Peter .
- References:
- Re: how to prepend string to a string?
- From: flamesrock
- Re: how to prepend string to a string?
- Prev by Date: Re: scripting browsers from Python
- Next by Date: working with pointers
- Previous by thread: Re: how to prepend string to a string?
- Next by thread: array concatenation
- Index(es):
Relevant Pages
|