[EMAIL PROTECTED] schrieb:
> hi
> is there a string method to insert characters into a string?
> eg
> str = "abcdef"
> i want to insert "#" into str so that it appears "abc#def"
>
> currently what i did is convert it to a list, insert the character
> using insert() and then join them back as strin
Em Sex, 2006-03-17 às 17:32 -0800, [EMAIL PROTECTED] escreveu:
> is there a string method to insert characters into a string?
As far as I know, no. Strings are immutable in Python. That said, the
following method may do what you want:
def insert(original, new, pos):
'''Inserts new inside
hi
is there a string method to insert characters into a string?
eg
str = "abcdef"
i want to insert "#" into str so that it appears "abc#def"
currently what i did is convert it to a list, insert the character
using insert() and then join them back as string..
thanks
--
http://mail.python.org/mai