[EMAIL PROTECTED] wrote:
> Martin Kulas:
>> Are there better (faster) ways to achieve my goal?
>> I have looked through the methods of type ``string''
>> but I have not found any appropriate method or function.
[...]
> A second way is to use a list of strings with len=1. Like this:
>>>> idx = 1
>>>> s1 = "pxthon"
>>>> l1 = list(s1)
>>>> l1[idx] = 'y'
> ... more processing on the elements of l1, then at the end:
>>>> "".join(l1)
> 'python'

There is a MutableString class that would be a better approach:
http://docs.python.org/lib/module-UserString.html

Anyway, I bet that what Martin wants to do can be done by using only string
methods :)
-- 
Roberto Bonvallet
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to